and and or in python code example

Example 1: python larger or equal

# To test if something is larger or equal use '>='
5 >= 10
# Output:
# False

Example 2: python or

x = 1
y = 10

if x%2 == 0 or y%2 == 0:
  print(x%2)
  
#Output#
#1

Example 3: ** in python

#** is the exponent symbol in Python, so:
print(2 ** 3)
#output: 8

Example 4: or in python

# Syntax for Boolean expression with or in Python
exp1 or exp2

Example 5: and in python

#And opreator in python

a = 12
b = 56

print(a and b * 12)

Example 6: arithmetic operators in python

Arithmetic operators: Arithmetic operators are used to perform mathematical 
  operations like addition, subtraction, multiplication and division.