how to convert local scope to global scope in python
#local scope
enemy = 5
def increase_enemy():
enemy = 10
return (f"enemy inside the function {enemy}")
print(increase_enemy())
print(f"Enemy out side the function {enemy}")
#converting local scope to global scope
enemy = 5
def increase_enemy():
global enemy
enemy = 10
return (f"enemy inside the function {enemy}")
print(increase_enemy())
print(f"Enemy out side the function {enemy}")