Answers for "global and local scope in python"

2

global and local scope in python

########Scopes#######
#local scope 
def drink_portion():
    portion_strenth = 10
    return portion_strenth
print(drink_portion())
#print(portion_strength) #will give error

###########global scope###########

player_Health = 100
def Got_hit():
    health_dropped = 5
    leval = player_Health - health_dropped
    return leval
print(Got_hit())
Posted by: Guest on August-29-2021

Code answers related to "global and local scope in python"

Python Answers by Framework

Browse Popular Code Answers by Language