Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /customers/c/c/9/esploradores.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 MICROPYTHON ESP32 – CONCEPTOS BÁSICOS de Python Operadores aritméticos – ESPloradores

MICROPYTHON ESP32 – CONCEPTOS BÁSICOS de Python
Operadores aritméticos

OPERACIONES ARITMÉTICAS

Los operadores aritméticos se utilizan para realizar operaciones matemáticas comunes entre valores numéricos:

OPERADORNOMBRE EJEMPLO
+Sumax + y
-Restax – y
*Multiplicaciónx * y
/Divisiónx / y
//División enterax // y
%Resto de la división (módulo)x % y
**Exponenciación (o potenciación) x ** y

Los operadores de suma+” , resta” y multiplicación*” no presentan ninguna dificultad.

Resultan algo más confusos los operadores de división/“, división entera//” y resto -de la división- (o módulo) “%“, pero en la siguiente imagen podemos ver claramente las diferencias entre ellos, para poder distinguirlos:

  • Con el operador de división obtenemos como resultado el cociente (que será un número flotante -float).
  • Con el operador de división entera obtenemos como resultado la parte entera del cociente y con el operador de resto obtenemos el resto –de la división-. Ambos serán números enteros -int-.

Utilizando el intérprete (Shell) de Thonny como una calculadora, así será como se ve un ejemplo de los operadores aritméticos de división, división entera y resto:

Por último, con el operador de exponenciación (o potenciación) obtenemos como resultado un número –base– elevado a otro número –exponente-.

Utilizando en la exponenciación exponentes decimales o negativos se pueden calcular raíces n-ésimas o potencias inversas.

Veamos unos ejemplos de exponenciación:

PRIORIDAD DE OPERACIONES

Cuando en una fórmula aparecen varias operaciones, Python las efectúa aplicando las reglas usuales de prioridad de las operaciones:

  • Primero exponenciaciones.
  • Después multiplicaciones y divisiones.
  • Por último las sumas y restas.

En caso de querer aclarar el orden de las operaciones o que las operaciones se realicen en otro orden, se deben utilizar paréntesis.

[button special_style=”yes” border_radius=”2″ three_d=”yes” size=”large” color=”pumpkin” title=”CONCEPTOS BÁSICOS DE PYTHON: NÚMEROS” link=”https://www.esploradores.com/numeros/” icon=”hb-moon-arrow-left-3″]
[button special_style=”yes” border_radius=”2″ three_d=”yes” size=”large” color=”emerald” title=”CONCEPTOS BÁSICOS DE PYTHON: OPERADORES DE ASIGNACIÓN” icon=”hb-moon-arrow-right-4″ link=”https://www.esploradores.com/operadores_de_asignacion/”]

Si el contenido del artículo te ha parecido interesante y vas a hacer una compra en Amazon, puedes colaborar con el blog realizando la compra siguiendo el enlace que aparece a continuación. El precio es el mismo para ti, pero este blog recibira una pequeña comisión sobre tu compra.

Publicado por Dani No

Es un diseñador de inventos revolucionarios que le podrían convertir en el hombre mas más rico del mundo. Es un maker que publica tanto unos artículos que son geniales como otros que son infumables. Años de experiencia y fracasos en proyectos tecnológicos le avalan.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *