0
What is the % operator used for?
I don't know
3 Respostas
+ 1
used for find prime numbers for exemple, it is very usefull in cryptography.
0
% = modulo
In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus).
Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder of the Euclidean division of a by n.
0
It's called a modulo operator which simply grabs the remainder of the division of a number by the other.
In Python:
5 % 2 = 1 (remainder of 5÷2 is in fact 1)