Write a program to accept a name containing three words and display the surname first followed by the first and middle names .
Input : MOHANDAS KARAMCHAND GANDHI
Output:GANDHI MOHANDAS KARAMCHAND
Answers
Answered by
1
name = input("Enter name: ").split()
print(" ".join([name[-1], *name[:-1]]))
Similar questions