python3 -m venv api_demo #Create "api_demo" virtual environmentsource api_demo/Scripts/activate #Activate "api_demo" environmentdef dosomething():
""" this is the area to document function specifics so when calling function you have a reminder of what it does and it's a good practicee in python coding """
return something
variable_global = 5
def game():
variable_local = 5
variable = 0
def game():
global variable
variable += 1
game()
print(variable) # Output should be 1
enemies = 1
def increase_enemies():
enemies = 2
print(f"enemies inside function: {enemies}")
increase_enemies()
print(f"enemies outside function: {enemies}"))
enemies = 1
def increase_enemies():
enemies = 2
print(f"enemies inside function: {enemies}")
return enemies - 1
increase_enemies()
print(f"enemies outside function: {enemies}"))
PI = 3.14159 URL = "https://www.google.com"