if else python
# IF ELSE ELIF
print('What is age?')
age = int(input('number:')) # user gives number as input
if age > 18:
print('go ahead drive')
elif age == 18:
print('come personaly for test')
else:
print('still underage')
if else python
# IF ELSE ELIF
print('What is age?')
age = int(input('number:')) # user gives number as input
if age > 18:
print('go ahead drive')
elif age == 18:
print('come personaly for test')
else:
print('still underage')
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)
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