python if statement if code example
Example 1: if statements python
water = input('Does your creature live underwater?')
if water == 'yes':
print('Your creature lives underwater')
else:
print('Your creature does not live underwater')
Example 2: 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")