What's your name, Tuple - HackerRank solution in python
Solution for hackerRank problems What's your name, Tuple in Python.
1. What's your name
You are given the first name and lastname of a person on two different lines. Your task is to read them and print the following:
"Hello firstname lastname! You just delved into python."
Function Description
Complete the print_full_name function in the editor below.
print_full_name has the following parameters:
- string first: the first name
- string last: the last name
Prints
string: 'Hello firstname lastname! You just delved into python' where firstname and lastname are replaced with first and last.
Input Format
The first line contains the first name, and the second line contains the last name.
Constraints
The length of the first and last names are each ≤ .
Sample Input 0
Ross
Taylor
Explanation 0
The input read by the program is stored as a string data type. A string is a collection of characters.
Procedure :
1. Start.
2. Get first name and last name from user.
3. Create a function to perform the given operation.
4. Concatenate the first name and last name to get the desired output.
5. Call the function wherever required.
6. End
Code :
- + => used to concatenate string
- print() => Prints the data
- map()- used to apply the given function to each item of a given iterable (list, tuple).
- split()- splits the input based on the given delimiter and returns a list. It
- hash()- returns the hash value of an object.
Comments
Post a Comment