Answers for "python if and"

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
19

or statement python

if x==1 or y==1:
  print(x,y)
Posted by: Guest on March-20-2020
5

if statement in python

#Conditionals statements in python
#'=' conditionals statements
a = 123
b = 123

if(a==b):
  print('True')
  
#<, > conditionals statements

a = 2
b = 45

if(a<b):
  print('A is smaller than B')
Posted by: Guest on October-04-2020
8

if statement in python

answer = input(":")
if answer == "lol":
  print("haha")
else:
  print("not haha")
  exit()

please note that the exit() command is optional and is not necessary.
Posted by: Guest on June-17-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

Python Answers by Framework

Browse Popular Code Answers by Language