You need to call global inside the function in order to access the global variable.
global
def player(): global health health = 100 player() print(health)
Output
100