if statement python
#a statement that checks if a condition is correct
#example:
x=5
if x == 5:
print("x is 5")
else:
print("x is not 5")
if statement python
#a statement that checks if a condition is correct
#example:
x=5
if x == 5:
print("x is 5")
else:
print("x is not 5")
else if python
word = input('Word: ') # This will ask you to print a word
if word == 'hello': # <- If your response is: 'hello'
print('world') # <- It will output: 'world'
elif word == 'world': # If the response is: 'world'
print("Hey, that's my line >:(") # It will print this
else:
print("Hey buster you gonna say hello or not?")
# If sombody prints ANYTHING ELSE other than 'hello' or 'world'
# It will output that print statment above!
#Hope this helped you!
python if condition
if my_condition:
# Do some stuff
print("Hello You!")
else:
# Do some stuff
print("Hello World!")
if statement python
number = 5
if number == 5:
print("number equals 5")
else:
print("number does not equal 5")
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")
if statement python
x = int(input("number: ")) # get number from user
if x < 0:
print(f"{x} is less than 0!") # if x is less than 0, print x is less than 0
elif x == 0:
print(f"{x} is equal to 0!") # if x is equal to 0 then print x is equal to 0
if x > 0:
print(f"{x} is more than 0!") # if x is greater than 0 print x is more than 0
# yeah its me somewhatoriginal
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