x=1 def example(): #you cant have a local variable named x and then declare x global coz error global x x=x+1 #the global variable is 2 now