I have this function that is supposed to count points but it doesn\'t add them:
def Correct(totalPoints):
print \"Correct\"
totalPoints = totalPoints+1
1) you're not returning the value from the function 2) global variables are best changed outside of functions - outside of the function, set the variable equal to whatever the function returns or - if you MUST do it inside the function, you want to declare it to be global at the beginning of the function.
def Correct(totalpoints):
return totalpoints += 1
......
if NBAANSWER == NBA2[NBAQues]:
print "Correct!"
totalpoints = Correct(totalPoints)
print "You have ", totalpoints, "points"