Computer Science, asked by riyamardi88, 1 year ago

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 jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

name = input("Enter name: ").split()

print(" ".join([name[-1], *name[:-1]]))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions