Block Scope
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Main Block
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block A
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block B
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block C
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block D
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block E
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Variable x
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Variable y
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Variable z
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Variable a
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Variable b
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
y = 0
z = 0
a = 0
b = 0
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10: function
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Function Scope
x = int(input("Enter a number: "))
if x > 5:
y = int(input("Enter a number: "))
if y > 10:
z = 10
else:
z = 5
elif x < 0:
a = -5
else:
b = 0
print("?")
Block Scope # Global block x = int ( input ( "Enter a number: " )) if x > 5 : # block A y = int ( input ( "Enter a number: " )) if y > 10 : # block B z = 10 else : # block C z = 5 elif x < 0 : # block D a = - 5 else : # block E b = 0 print ( "?" )