Advertisement
Fhernd

redondear.py

Jan 17th, 2018
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. import math
  2.  
  3. numero_decimal = 2.7172
  4.  
  5. # Redondear:
  6. print(int(numero_decimal))
  7.  
  8. # Truncar la parte decimal:
  9. print(math.trunc(numero_decimal))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement