Dan
0
Q:

and 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
if (condition):
   result
    
else:
   result
13
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
x=1; y=0; z=0;
if 1 in {x,y,z}:
  print('At least one variable is equal to 1')
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
#And opreator in python

a = 12
b = 56

print(a and b * 12)
1
if (condition):
  result
7
# 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
% : Modulus - remainder of the division of left operand by the right
  	x % y (remainder of x/y)
2

New to Communities?

Join the community