Answers for "python or in if statement"

42

python if statement

usrinput = input(">> ")
if usrinput == "Hello":
  print("Hi")
elif usrinput == "Bye":
  print("Bye")
else:
  print("Okay...?")
Posted by: Guest on May-13-2020
5

python if and

if foo == 'abc' and bar == 'bac' or zoo == '123':
  # do something
Posted by: Guest on December-22-2020
12

python if

if num<5:
  print('Num less than 5')
elif 5<= num <=9:
  print('Num between 5 and 9')
else:
  print('Num more than 9')
Posted by: Guest on May-21-2020
2

python if condition

if my_condition:
  # Do some stuff
  print("Hello You!")
else:
  # Do some stuff
  print("Hello World!")
Posted by: Guest on January-16-2021
1

python if condition

a = 200
b = 33
if b > a:
  print("b is greater than a")
else:
  print("b is not greater than a")
Posted by: Guest on June-30-2021
0

python or in if statement

weather = input("How's the weather? ")

if weather == "Good!" or weather == "Great!": 
	print('Glad to hear!')
else: 
	print('Too bad!')
Posted by: Guest on January-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language