0

How do i integrate the class with the list?

So that i’m able to to print the age of the first person who was put into the system(print(personList[0].age) Change the input part meybe? https://code.sololearn.com/cHZJR5uYk4yH/?ref=app

24th Feb 2022, 11:12 PM
Lenoname
4 Réponses
+ 1
https://m.youtube.com/watch?v=PxZE0e-ePoI Walk through of an address book in python same concepts you want to learn.
25th Feb 2022, 12:50 AM
William Owens
William Owens - avatar
0
So you want to create a list of objects then print specific attributes of specific objects within the list?
24th Feb 2022, 11:35 PM
William Owens
William Owens - avatar
0
William Owens i’m new to this so i dont know what to call it, its a loop where the user gets asked to input a name, an age and the gender of a person(4x). After that these informations are put in a list. But the list should be associated with the class somehow ,so when i print(personList[0].age)i would get the age of the first person which was put in.
25th Feb 2022, 12:01 AM
Lenoname
0
Jay Matthews where can i put the input?
25th Feb 2022, 12:02 AM
Lenoname