xxxxxxxxxx
# the 1st technique is standard way of calculating modulus
# the 2nd technique is doing samething using // operator
print(10%7)
print(10 - (7 * (10//7)))
# Output:
# 3
# 3
xxxxxxxxxx
# floor devision and modulo
def euclidean_division(x, y):
quotient = x // y
remainder = x % y
print(f"{quotient} remainder {remainder}")
euclidean_division(1, 7000)
# finds both in one function
xxxxxxxxxx
if i%2 == 0 :
print("the Number is Odd")
else:
print("the Number is even")