Q:

or statement 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
Operator:		and
Syntax:			x and y
Description:	True if both the operands are true

# Examples of Logical Operator 
a = True
b = False
  
# Print a and b 
print(a and b) # False 
3
if x==1 or y==1:
  print(x,y)
9
if num<5:
  print('Num less than 5')
elif 5<= num <=9:
  print('Num between 5 and 9')
else:
  print('Num more than 9')
11
x=1; y=0; z=0;
if x==1 or y==0:
  if z=0 and x=1:
    print('Useless conditions satisfed!')
8
# Syntax for Boolean expression with or in Python
exp1 or exp2
6
if (condition):
  result
7
#if you are doing this
if X=1
#Do this
if X==1
0

New to Communities?

Join the community