local variable referenced before assignment python 3 how to fix code example
Example: python local variable referenced before assignment
variable = "Hello"
def function():
global variable
print(variable)
function()
variable = "Hello"
def function():
global variable
print(variable)
function()