python conditional if code example
Example 1: condition ? expr If True : expr If False
condition ? expifTrue : expIfFalse;
Example 2: conditional and in python
if 1 > 2 and 4 < 10:
print("condition not met")
if 4 < 10 or 1 < 2:
print("condition met")
Example 3: conditional block python
a = 1
b = 2
if a < b:
print("a is less than b") #This will run since 1 is less than 2
elif a > b:
print("a is greater than b")
else:
print("a is equal to b")