0
Q:

else if python

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")

 
44
usrinput = input(">> ")
if usrinput == "Hello":
  print("Hi")
elif usrinput == "Bye":
  print("Bye")
else:
  print("Okay...?")
  
10
x=1; y=0; z=0;
if 1 in {x,y,z}:
  print('At least one variable is equal to 1')
9
x=1; y=0; z=0;
if x==1 or y==0:
  if z=0 and x=1:
    print('Useless conditions satisfed!')
8
if expression1:
   statement(s)
elif expression2:
   statement(s)
elif expression3:
   statement(s)
else:
   statement(s)
5

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")

 
1
if (condition1):
  print('condition1 is True')
elif (condition2):
  print('condition2 is True')
else:
  print('None of the conditions are True')
8
if (condion):
   result
    
elif (condition):
   results
    
else:
   result
6
if (condition):
  result
7
>>> a = 5
>>> if a > 5:
...     a = a + 1
... elif a == 5:
...     a = a + 1000
... else:
...     a = a - 1
... 
>>> a
1005
0

New to Communities?

Join the community