Operators in Python
Arithmetic (including // and **), comparison, logical (and, or, not) and the in operator, with interactive labs.
Python tiene los operadores habituales más dos muy suyos: // (división entera)
y ** (potencia). Los lógicos se escriben con palabras:
and, or, not.
Arithmetic
7 / 2 da 3.5 (float, siempre). 7 // 2
da 3. 2 ** 10 da 1024.Comparison and chained comparisons
Devuelven True/False. Y Python permite encadenar: 0 < x < 100.
Logical: and, or, not
The in operator
in comprueba si algo está dentro de una lista, un texto o un diccionario (mira las claves).
Check what you've learned
10 / 4 en Python 3?3 ** 3 es…"a" in "casa" devuelve…