Tingimuslause tingimuslause sees¶
Tingimuslauseid võib olla ka teise tingimuslause sees.
# no pec
number = 8
if number > 5:
print("The number is larger than 5")
if number > 10:
print("The number is larger than 10")
else:
print("The number is smaller than 10")
if number == 8:
print("The number is 8")
# Output:
# The number is larger than 5
# The number is smaller than 10
# The number is 8