points = 0 def inc() : global points points += 1 print points def dec() : global points points -= 1 print points while True : a = input('1 : inc, 2 : dec ?') if a == 1 : inc() elif a == 2 : dec() else : break