globalvar = "flower"
def editglobalvar():
global globalvar # accesses the "globalvar" variable, so when we change it
# it won't assign the new value to a local variable,
# not changing the value of the global variable
globalvar = "good" # assigning new value
print(globalvar) # outputs "flower"
# if we didnt use the "global" keyword in the function, it would print out
# "flower"
#A global variable can be accessed from the hole program.
global var = "Text"
c = 1 # global variable
def add():
c = c + 2 # increment c by 2
print(c)
add()