They can access variables that are outer to them and can redefine them within their own scope _and_ within the global scope using the keywords `global` and `nonlocal`.
Below a global variable is accessed and changed but only internally within a function scope
```py
max = 100
print('initial value of max:', max)
def print_max():
global max
max = max + 1
print('inside function:', max)
print_max()
print('outside function:', max)
"""
initial value of max: 100
inside function: 101
outside function: 101
"""
```
Below a higher-scoped variable is redefined from within the lower scope:
```py
def myfunc1():
x = "John"
def myfunc2():
nonlocal x
x = "hello"
myfunc2()
return x
print(myfunc1())
# hello
```
We cannot however redefine a global variable from a function scope permanently. It will remain whatever it is in global scope, after the function has run.