0
Para que sirve el porciento(%) en python) (RESUELTO)
4 odpowiedzi
+ 4
Dorian Estévez
Es el resto de un problema de división, como en el ejemplo 17 dividido por 3 es 5 con un resto de 2. El resultado del símbolo de módulo (%) es 2.
+ 2
Google is your friend.
Python supports a wide range of arithmetic operators that you can use when working with numbers in your code. One of these operators is the modulo operator ( % ), which returns the remainder of dividing two numbers.
[Source: https://realpython.com]
For example, 10 % 3 is equal to 1 (3 remainder 1).
Similarly, 13 % 7 is equal to 6 (1 remainder 6).
Percentage sign ( % ) also works with formatting string, but the usage is not covered in here.
+ 2
Gracias