I Modulo 2 Python. The variable value is displayed that should. The modulo operation is supported for integers and floating point numbers.
The python modulo operator, %, is used to retrieve the remainder after a division. The modulo operation is supported for integers and floating point numbers. The variable value is displayed that should.
The diagram below shows a visual representation of 7 / 2 and 7 % 2 (the r stands for remainder).
Basically, python modulo operation is used to get the remainder of a division. You can rate examples to help us improve the quality of examples. There, i am simply using the two numbers with '%' operator and assigning the remainder value to a variable. How do i use modular arithmetic on a list, i wish to mod 121 after each enumerated number?
Nessun commento:
Posta un commento