Using Python Write Program Requests Two Part Name Displays Name Form Lastname Firstname O Q37070260

Using Python

Write a program that requests a ­two-­part name and thendisplays the name in the form “lastName, firstName”.

One possible outcome: Enter a 2-part name: John Doe Revisedform: Doe, John


Solution


name = input(“Enter a 2-part name: “).split()print(“Revised form: ” + name[1] + “, ” + name[0])

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.