On Python, ask the user to input their first name and last name separated by a blank. Then print to the output the last name followed by a comma, a blank and first name.
n=input("Enter first name and last name seperated by
blank")#read input from user
l=n.split(" ")#split by blank space and store in list l
print("last name is ",l[1],", and first name is ",l[0])#print the
first and last names
Screenshots:
The screenshots are attached below for reference.
Please follow them for output.
Please upvote my answer.
Please let me know below in the comments section in case of any help needed. Thank you.
Get Answers For Free
Most questions answered within 1 hours.