Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enemies = 1
- print(enemies)
- def increase_enemies():
- return enemies + 1
- #print(f"enemies inside function: {enemies}")
- enemies = increase_enemies()
- print(f"enemies outside function: {enemies}")
- #local scope
- # def drink_potion():
- # potion_strength = 2
- # print(potion_strength)
- #drink_potion()
- # #global scope
- # player_health = 10
- # def drink_potion():
- # potion_strength = 2
- # print(potion_strength)
- # print(player_health)
- # drink_potion()
- # print(player_health)
- #globalconstants
- PI = 3.14
- URL = "google.com"
Add Comment
Please, Sign In to add comment