Answer:
def UpdateScore(score, total):
if total % 2:
print total, "is odd, so adding 10"
score += 10
else:
print total, "is even, so subtracting 5"
score -= 5
print "The score is now",score
return score
score = 0
score = UpdateScore(score, 3)
score = UpdateScore(score, 6)
Explanation:
The % operator returns the remainder after division. So if you divide by 2, the remainder is either 0 or 1, where 0 indicates an even number, and 1 indicates an odd number. The above program shows that.