use python function to change global variable code example Example: how to declare global variable in python global n n = 'whatever'