What does the % in a calculation? I can\'t seem to work out what it does.
%
Does it work out a percent of the calculation for example: 4 % 2
4 % 2
Also, there is a useful built-in function called divmod:
divmod(a, b) Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using long division.
divmod(a, b)
Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using long division.