how to save a value from a funtion into a global variable in python code example Example: how to declare global variable in python global n n = 'whatever'