Exemple de code de l'opérateur de modulo Python
# function is defined for finding out
# the remainder of every number from 1 to n
def findRemainder(n, k):
for i in range(1, n + 1):
# rem will store the remainder
# when i is divided by k.
rem = i % k
print(i, "mod", k, "=", rem, sep = " ")
# Driver code
if __name__ == "__main__" :
# inputs
n = 10
k = 7
# function calling
findRemainder(n, k)
Outrageous Ostrich