Answered step by step
Verified Expert Solution
Link Copied!

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 sorting_people.py file you'll create.After importing the person module, you will be able to create a Person object like this: person.Person("Smith", "John"), where the two arguments are the person's last and first names. For example,import personp = person.Person("Smith", "John")print(p)Use 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? 3First 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago