Python Forum

Full Version: GPA Calculator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello! I am new to Python and am trying to make a GPA calculator. I have what it should look like in my head but don't know how to actually do it. I would like it so the person can put in how many classes they are in and, when they do, that many user inputs will pop up so they can enter their grades. But I do not know how to get it to do this. For example, if they are in 6 classes I would like it to print "Enter Grade Here: " six times. And then they may enter their grades. I would like the same thing to happen with class credits.
Entering the number of classes would use input(). However, input returns a string, which you would need to convert to an integer with int(). Then you would start with an empty list of grades, make a range() of the number of classes, and loop through that with a for loop. Each time through the loop, input() the next grade and append it to the list of grades.