Answers for "if else statements python"

3

how to use if else in python

print("Welcome to Rolercoster rider")
print()
#taking input of your hight
Your_hight = int(input("What is Your hight:- "))
#if condition 
if Your_hight >= 120:
    print("You are good to go to the roller coster")
else:
    print("Grow taller to go to the rolercoster")
Posted by: Guest on July-31-2021
2

if else python

# IF ELSE ELIF
age=int(input("Enter your age:"))
if age<=18:
  print("sorry your are not eligible for vote")
elif age>=18:
  print("u are eligible for vote")
else:
  print("in some how the previou's condition fails else part will run")
Posted by: Guest on January-01-2021
1

else if python

name = input("What's your name? n") # Asks user for a name

# Following if order:
# first program checks if the if is true
# next program lists down the elifs (or else ifs) in the order 
# in which they are listed
# Lastly, if there is an else, program does whatever is inside
# of there.

if name == "Aguy12": # First checks if they answered "Aguy12"
  print("Wait a second...")
elif name == "Aguy11": # Then checks if they answered with "Aguy11"*
  print("Now that's definitely not true")
else: # If none of those are true greets the person accordingly
  print(f"Hello, {name}!")
  
# * ONLY IF THE IF STATEMENT IS NOT TRUE
Posted by: Guest on January-23-2021
1

if else python

if condition:
   result
elif condition:
   result
else:
   result
Posted by: Guest on January-11-2021
1

if statements python

water = input('Does your creature live underwater?')
if water == 'yes':
	print('Your creature lives underwater')
else:
	print('Your creature does not live underwater')
Posted by: Guest on October-17-2020
0

python else if

a = 200
b = 33
if b > a:
  print("b is greater than a")
elif a == b:
  print("a and b are equal")
else:
  print("a is greater than b")
Posted by: Guest on November-03-2021

Code answers related to "if else statements python"

Python Answers by Framework

Browse Popular Code Answers by Language