Answers for "pythom if else statements with and conditions"

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
0

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.')
Posted by: Guest on September-08-2021

Code answers related to "pythom if else statements with and conditions"

Python Answers by Framework

Browse Popular Code Answers by Language