Your start function explicitly allows access to a global variable named var
. As evidenced by your error, you have no such variable defined. Please initialize the variable before the function:
var = 25
def start():
global var
# the rest of your function
# goes here after global var
3
solved Pass variables through functions in Python 3