condition python
ensoleille = False
neige = True
if ensoleille:
print("on va à la plage !")
elif neige:
print("on fait un bonhomme de neige")
else:
print("on reste à la maison !")
condition python
ensoleille = False
neige = True
if ensoleille:
print("on va à la plage !")
elif neige:
print("on fait un bonhomme de neige")
else:
print("on reste à la maison !")
python condition
if condition:
# stuff
elif condition:
# stuff
else:
# stuff
# EXEMPLE #
hour = 14
if hour < 8: # if hour is less than 8
print("It's morning")
elif hour < 18: # if hour is beetween 8 and 18
print("It's the day")
else: # if hour is upper than 18
print("It's the evening")
conditional and in python
if 1 > 2 and 4 < 10:
print("condition not met")
if 4 < 10 or 1 < 2:
print("condition met")
python conditionals
a == b (is equal)
a != b (is not equal)
a < b (a is less than b)
a > b (a is greater than b)
a <= b (a is less than or equal to b)
a >= b (a is greater than or equal to b)
condition ? expr If True : expr If False
condition ? expifTrue : expIfFalse;
condition python
with_sun = True
in_week = False
if with_sun and not in_week:
print("we go to the beach !")
elif with_sun and in_week:
print("we go to work !")
else:
print("we stay at home !")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us