Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this question, you need the provided person module saved in the same folder as the sorting _ people.py file you'll create.After importing the person
For this question, you need the provided person module saved in the same folder as the sortingpeople.py file you'll create.After importing the person module, you will be able to create a Person object like this: person.PersonSmith "John" where the two arguments are the person's last and first names. For example,import personp person.PersonSmith "John"printpUse this class to create a program like this that asks the user for some number of people's names. It should build a list of Person objects in a loop, sort it with the list's sort method and then print the people out by going through the sorted list.How many people? First name: ApuLast name: NahasapeemapetilonFirst name: MontgomeryLast name: BurnsFirst name: AgnesLast name: SkinnerHere they are in order:Burns, MontgomeryNahasapeemapetilon, ApuSkinner, Agnes If you print a Person object, it will be printed in the lastname, firstname format you need. You can also extract the last and first name with the lastname and firstname methods.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started