# operators
# - boolean values: True, False
# - not (negates)
# - and (both conditions must be true)
# - or (at least one condition must be true)
# - <, >, <=, >=, ==, !=
if x > y:
print("This prints if expression evaluates to True, meaning x is greater than y")
else:
print("This prints if expression evaluates to False, meaning x is NOT greater than y")
# Several different conditional statements that all print the correct statement about a person's age
# for these examples, assume a variable 'age' has been assigned the person's age in years
# then one of the following statements will be printed:
#
# You are a PRE-TEEN
# You are a TEENAGER
# You are a POST-TEEN
#
# Example A - Sequential Conditional Statements
#
if age < 13:
print("You are a PRE-TEEN")
if age > 19:
print("You are a POST-TEEN")
if age > 12 and age < 20:
print("You are a TEENAGER")
# Example B - IF - ELIF - ELSE Conditional Statements
#
if age < 13:
print("You are a PRE-TEEN")
elif age > 19:
print("You are a POST-TEEN")
else:
print("You are a TEENAGER")
# Example C - Nested Conditional Statements - Version 1
#
if age > 12:
if (age < 20):
print("You are a TEENAGER")
else:
print("You are a POST-TEEN")
else:
print("You are a PRE-TEEN")
#Example D - Nested Conditional Statements - Version 2
#
if age < 20:
if age < 12:
print("You are a PRE-TEEN")
else:
print(""You are a TEENAGER")
else:
print("You are a POST-TEEN")
#Example E - Nested Conditional Statements - Version 3
#
if age > 19:
print("You are a POST-TEEN")
else:
if age < 12:
print("You are a PRE-TEEN
else:
print("You are a TEENAGER")
#OVERLY COMPLEX ONE
if not (age < 13 or age > 19):
print("You are a TEENAGER")
elif age < 13:
print("You are a PRE-TEEN")
else:
print("You are a POST-TEEN")
# Other examples of conditional statements
x = 3
y = 5
if x==2 or y==6:
print("x is 2")
print("more code")
elif x==2:
print("x is 2 again")
elif x==4:
print("x is 4")
#else:
# print("x is not 2")
# print("even more code")
print("hello students")
x = 2
y = 5
# if (x == 2): # True if the value of x IS 2
#if x!=2: # True if the value of x IS NOT 2
if (not (x == 2)):
print("A")
if y==5:
print("A1")
else:
print("A2")
elif y==5:
print("B")
if (x>5):
print("B1")
else:
print("B2")
else:
print("C")