Int / modulus
Int and modulus are two pre-defined functions that you need to know for the higher course.
- int – converts a floating point number to an integer
- modulus – returns the remainder from a division
Modulus
- Modulus returns the remainder from a division.
- The modulus operator in Python is %.
print(10 % 4) # Output - 2 print(9 % 4) # Output - 1 print(100 % 33) # Output - 1