Advertisement
Fhernd

calculos-precios-decimales.py

May 9th, 2018
3,675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. from decimal import Decimal
  2.  
  3. numero_1 = 4.2
  4. numero_2 = 2.1
  5. print(numero_1 + numero_2)
  6. print((numero_1 + numero_2) == 6.3)
  7.  
  8. numero_1 = Decimal('4.2')
  9. numero_2 = Decimal('2.1')
  10. print(numero_1 + numero_2)
  11. print((numero_1 + numero_2) == Decimal('6.3'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement