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 syntax in python
variable_name = input("y/n? >> ")
if variable_name == "y":
print("That's good! :) ")
# note the double equal signs. only a single equal sign will receive a Syntax error blah blah blah message.
elif variable_name == "n":
print("That's bad! :( ")
else:
print("You blow up for not following my instructions. Detention forever and get lost!")
python if condition
if my_condition:
# Do some stuff
print("Hello You!")
else:
# Do some stuff
print("Hello World!")
python if
if num==5:
print("Num equal to 5")
elif num > 5:
print("Num more than 5")
else:
print("Num smaller than 5 but not equal to 5")
or in if statement python
weather == "Good!" or weather == "Great!":
# Or the following
weather in ("Good!", "Great!"):
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