Operaciones Matemáticas y Lógicas

Lesson 9/17 | Tiempo de estudio: 15 Min

 ➕ Operaciones básicas:

a = 10
b = 3
print(a + b)   # 13
print(a - b)   # 7
print(a * b)   # 30
print(a / b)   # 3.33
print(a // b)  # 3
print(a % b)   # 1
print(a ** b)  # 1000


OperadorSignificado
+Suma
-Resta
*Multiplicación
/División
//División entera
%Módulo (resto)
**Potencia


Operaciones lógicas:

x = 5
y = 10
print(x < y and y > 5)   # True
print(not (x == y))      # True


OperadorSignificado
==Igual a
!=Diferente
>Mayor que
<Menor que
>=Mayor o igual que
<=Menor o igual que
andY
orO
notNo (negación)

Configuración de Cookies

When you visit any of our websites, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and manage your preferences. Please note, that blocking some types of cookies may impact your experience of the site and the services we are able to offer.