I have this function that is supposed to count points but it doesn\'t add them:
def Correct(totalPoints):
print \"Correct\"
totalPoints = totalPoints+1
totalPoints
is being cloned inside your function. To do what you want, you should set totalPoints
based on the function result, like so:
def Correct(totalPoints):
print "Correct"
totalPoints = totalPoints+1
print "You have", totalPoints,"points"
return totalPoints
totalPoints = Correct(totalPoints)
This ignores why you would want such a function in the first place, but it should work.