Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 7 Online
OpenStudy (anonymous):

GPA Card, exercise 2.8. Please help

OpenStudy (anonymous):

How do I assign a string to an unknown number of classes? Going through my for loop I've found it hard to create a new string for each class. any clever ways of doing this? Here's my code so far. Ps: it doesn't work ###GPA CARD#### number_of_classes = int(raw_input('how many classes did you take?')) classes = 0 for grades in range(0, number_of_classes): nameOfClass[grades] = raw_input('Name of the class?') print grades print nameOfClass[grades]

OpenStudy (tyteen4a03):

I don't know what this exercise is about, but nameOfClass is undefined and classes is not used.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!