python modulus
# 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
python modulus
# 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
how to modulus in python
# let say "a" is our varable then,
# and that is a is 25
a % 10
# then this returns 5 because % gets the remainder of a / 10
python mod function
#the modulus operator is % in Python
5 % 3
#returns remainder: 2
python get reminder of the division
a % b
what is modulus in python
# Modulus is the reminder of the 2 divisions, ex 25 % 2 = 1
#ie, 2*12 = 24 and the number is 25 so when we divide 25/2 the reminder is 1
print(25%2)
# Output = 1
#Hope you understood that, have a nice day :D
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us