HACKER RANK Python Introduction Challenges - What's Your Name? Solution.'Py'
Python Introduction Challenges - What's Your Name? Solution
Problem Statement
Let's learn the basics of Python! You are given the first name and the last name of a person. Your task is to read them and print the following:
Hello firstname lastname! You just delved into python.
It's that simple!
In Python you can read a line as a string using
s = raw_input()
#here s reads the whole line.
Input Format
The first line contains the first name, and the second line contains the last name.
The first line contains the first name, and the second line contains the last name.
Constraints
The length of the first and last name ≤ 10.
The length of the first and last name ≤ 10.
Output Format
Print the output as mentioned above.
Print the output as mentioned above.
Sample Input
Guido
Rossum
Sample Output
Hello Guido Rossum! You just delved into python.
Concept The input read by the program is stored as a string data type. A string is a collection of characters.
Solution:
# Enter your code here. Read input from STDIN. Print output to STDOUT first_name = raw_input() last_name = raw_input() print "Hello "+ first_name +" " + last_name +"! You just delved into python."
Comments
Post a Comment