This is the piece of code where I have the problem occuring:
def gpa_calc(grade):
grades = []
honors = []
aps = []
totalgpa = 0.00
classes = int(raw_input("How many classes are you taking this year?"))
for i in range(classes):
grade = bool(raw_input("What is the grade letter of this class?(Ex.
A+,D-,C)"))
grades.append(grade)
honor = bool(raw_input("Is this an honor class?(True or False)"))
honors.append(honor)
ap = bool(raw_input("Is this an ap class?(True or False)"))
aps.append(ap)
for i in range(classes):
totalgpa = (grades[i],honors[i],aps[i])
finalgpa = totalgpa / classes
print ("Your final GPA is ", finalgpa, ".")
this is the error that occurs:
50 for i in range(classes):
51 totalgpa = (grades[i],honors[i],aps[i])
---> 52 finalgpa = totalgpa / classes
53 print ("Your final GPA is ", finalgpa, ".")
TypeError: unsupported operand type(s) for /: 'tuple' and 'int'
How do I fix this? Thank you in advance :D
