Python Local Global Variables Worksheet
Python Local Global Variables Worksheet
x = 100 # _____
def test():
y = 50 # _____
print(y)
test()
print(x)
name = "Ali"
Page 1
Python Worksheet: Local vs Global Variables
def greet():
name = "Sara"
print("Hello", name)
greet()
Your Answer:
Hello __________
3. Then inside the function, create a local variable called 'area' and print it too.
Page 2