Question: Create a Python program that: Allows the user to enter a person's first name and last name. The user should be able to enter as

Create a Python program that:

  • Allows the user to enter a person's first name and last name.
  • The user should be able to enter as many names as they desire.
  • Create a function that takes the first name and last name, puts them together with the last name first, followed by the first name; with the names separated by commas.
  • Take the result from the function, and place the resulting name in a list.
  • Once the user finishes entering names, sort the contents of the list.
  • Write the sorted names from a list into a text file. When you create the text file, allow the user to enter a name for the file to be created.
  • After you finish writing names to the file, close the file and end the program.

The program should:

  • Use variables with meaningful names
  • Display easily understood prompts when collecting user input
  • Prompt the user for the name of the file to save the data in
  • Have appropriate comments indicating what each part of the program is doing
  • Have a comment area at the beginning of the program identifying the author of the program and the class it was created for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!