Friday, 27 September 2013

TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'

TypeError: unsupported operand type(s) for +=:
'builtin_function_or_method' and 'int'

I am receiving this error (TypeError: unsupported operand type(s) for +=:
'builtin_function_or_method' and 'int') when trying to run this code
totalExams = 0
for totalExams in range (1, 100001):
sum += totalExams
print(sum)
sum = 0
totalExams = 0
while count <= 100000:
sum += totalExams
totalExams += 1
print(sum)
sum = int("Please enter Exam grade, or press 999 to end: ")
while true:
if sum <= 100:
sum += totalExams
totalExams += 1
elif sum == "999":
print(sum / totalExams)
over all i just need to run the program until 999 is entered, and then
find the average of all the numbers entered. At least a little help will
be nice.

No comments:

Post a Comment