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 3 class fields given in below ;
M_names =["Ahmet", "Mehmet", "Mert", "Veli"]
F_names =["Fatma", "Lale", "Aye","iek"]
genders =["Male", "Female"]
Class has constructor takes age,name and gender parameters
random_person method will choose its name and gender randomly from M_names,
F_names and 'genders' list and its age between 5-80
increase_age method returns age after 10 years
is_old method which returns True, if given age is greater than 60,False if is not.
Decide type of the all methods (class, instance or static method)
Finally, create p = Person(45,"Ali","Male") print today and future age and other attributes.
Create 10 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 45 Male
Ali will after 10 years 55 years old
Ahmet 61 Male
Fatma 50 Female
Lale 21 Female
iek 70 Female
Ahmet 61 Male
Ahmet 57 Male
Veli 77 Male
Mehmet 57 Male
iek 14 Female
Ahmet 64 Male
Old people count : 5

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 Programming Questions!