Update python.md

updating operations
This commit is contained in:
Gustavo Adolfo Mejía Sánchez 2025-01-09 15:42:24 -05:00 committed by GitHub
parent a556cdedce
commit 8dfd3dcbd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,13 +34,18 @@ Es básicamente pseudocódigo ejecutable.
# Sin embargo también tienes disponible división entera
34 // 5 # => 6
% El operador módulo
34 % 5 # => 4 # es el residuo de la división: 34 - (5 * 6) = 4
# Cuando usas un float, los resultados son floats
3 * 2.0 # => 6.0
# Exponenciación
4 ** 3 = 64 # 4^3 => 4*4*4 => 64
# Refuerza la precedencia con paréntesis
(1 + 3) * 2 # => 8
# Valores 'boolean' (booleanos) son primitivos
True
False
@ -49,7 +54,6 @@ False
not True # => False
not False # => True
# Igualdad es ==
1 == 1 # => True
2 == 1 # => False