Chris
0
Q:

what is % in python

# Syntax for Boolean expression with or in Python
exp1 or exp2
6
% : Modulus - remainder of the division of left operand by the right
  	x % y (remainder of x/y)
2
# operations in numbers with python 
a = 15
b = 3
#a and b are not expression because they are at the right side

print(a + b)    # this will add the numbers
print(a - b)    # this will subtract the numbers
print(a * b)    # this will multiply the numbers
print(a / b)    #this will divide the numbers
print(a // b)   #this will gives the reminder after division
2

New to Communities?

Join the community