It looks like this:
I define a class:
class Boy():
def __init__(self):
self.age = input()
self.height = input()
Then I define a list with the names of the boys that I want to be object instances of the above 'class Boy':
boys = [input(), input()]
(for example: john & frank, so that boys = ['john', 'frank'])
I want now to iterate over my list 'boys' and use each name to make an object of the 'class Boy':
for value in boys:
value = Boy()
Of course, it does not work :-) but is there a way to achieve it ?? I have been using Python since 1 week, if the question sounds silly :-) If someone could help me, will be very thankful
Thank you all for the help, I implemented the proposed solutions:
thank_you_people = ['Makoto','L3viathan','Rcynic','Pythonic','Paul Rooney', 'st.eve']
:-)
for person in thank_you_people:
print('Thank you, %s' % person)