Question: #Generate Person class with parameters age, name and gender #Class has 3 class fields given in below ; M _ names = [ Ahmet
#Generate Person class with parameters age, name and gender
#Class has class fields given in below ;
Mnames Ahmet "Mehmet", "Mert", "Veli"
Fnames Fatma "Lale", Ayeiek
genders Male "Female"
Class has constructor takes age,name and gender parameters
randomperson method will choose its name and gender randomly from Mnames
Fnames and 'genders' list and its age between
increaseage method returns age after years
isold method which returns True, if given age is greater than False if is not.
Decide type of the all methods class instance or static method
Finally, create p Person"Ali","Male" print today and future age and other attributes.
Create random Person and add them to list and print it to screen.
Find the count of old people and print it to screen.
Output:
Ali Male
Ali will after years years old
Ahmet Male
Fatma Female
Lale Female
iek Female
Ahmet Male
Ahmet Male
Veli Male
Mehmet Male
iek Female
Ahmet Male
Old people count :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
