0

Para que sirve el porciento(%) en python) (RESUELTO)

28th Oct 2023, 12:54 AM
Dorian Estévez
Dorian Estévez - avatar
4 Respuestas
+ 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.
28th Oct 2023, 1:34 AM
BroFar
BroFar - avatar
+ 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.
28th Oct 2023, 1:39 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 2
Gracias
28th Oct 2023, 2:23 AM
Dorian Estévez
Dorian Estévez - avatar