Claire
0
Q:

python else

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
if x==1 or y==1:
  print(x,y)
9
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
>>> a = 5
>>> if a > 5:
...     a = a + 1
... elif a == 5:
...     a = a + 1000
... else:
...     a = a - 1
... 
>>> a
1005
0
# python program to illustrate nested If statement 
#!/usr/bin/python 
i = 10
if (i == 10): 
    #  First if statement 
    if (i < 15): 
        print ("i is smaller than 15") 
    # Nested - if statement 
    # Will only be executed if statement above 
    # it is true 
    if (i < 12): 
        print ("i is smaller than 12 too") 
    else: 
        print ("i is greater than 15") 
1
#if you are doing this
if X=1
#Do this
if X==1
0

New to Communities?

Join the community