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')
if else in python
# The If and Elif statements in python check if a condition is true.
# If it is, it will run the code inside of the if/elif block.
# Elif is short for else if.
# The else statement is used if none of the conditions are true.
# Here's an example of if, elif and else:
num = int(input('Enter a number, either one, two or three. '))
if num == 1:
print('The number is 1.')
elif num == 2:
print('The number is 2.')
elif num == 3:
print('The number is 3.')
else:
print('Invalid input.')
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