You've already forked Curso-lenguaje-python
Restructure content and add notes from HolaMundo
Signed-off-by: Manuel Vergara <manuel@vergaracarmona.es>
This commit is contained in:
16
python-total/dia_02/02_Intengers_math.py
Normal file
16
python-total/dia_02/02_Intengers_math.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import math
|
||||
|
||||
print(round(1.3)) # redondeo al número más cercano
|
||||
print(round(1.7)) # redondeo al número más cercano
|
||||
print(round(1.5)) # redondeo al número más cercano
|
||||
print(abs(-77)) # Número absoluto
|
||||
print(abs(55)) # Número absoluto
|
||||
|
||||
# Con el módulo math. Todos los metodos en https://docs.python.org/3/library/math.html
|
||||
|
||||
print(math.ceil(1.1)) # Lleva al número más cercano hacia arriba
|
||||
print(math.floor(1.9999)) # Lleva al número más cercano hacia abajo
|
||||
print(math.isnan(23)) # Indica si no es un número el valor
|
||||
# print(math.isnan("23")) # Indica si no es un número el valor
|
||||
print(math.pow(10, 3)) # Potencia
|
||||
print(math.sqrt(25)) # Raiz cuadrada
|
||||
Reference in New Issue
Block a user