So I am working on a basic application, press a button and it adds the number to the total, the total is a global variable, but the program things it is a local variable.
totalCarbs = 0
apple = 12
def addCarbsToTotal(food):
if food == "Apple":
print("Apple")
totalCarbs += apple
print(totalCarbs)
Here is the code, any help would be appreciated.