• anonymous
GPA Card, exercise 2.8. Please help
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
  • Stacey Warren - Expert
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
  • schrodinger
I got my questions answered at in under 10 minutes. Go to now for free help!
  • 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]
  • tyteen4a03
I don't know what this exercise is about, but nameOfClass is undefined and classes is not used.

Looking for something else?

Not the answer you are looking for? Search for more explanations.