Advertisement
rfmonk

decimal_tuple.py

Jan 22nd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # credit for this goes to the author
  4. # of The Python Standard Library by example
  5. # Jesse Noller, Python Core Developer and PSF Board Member
  6. # Book can be purchased on amazon, it is also
  7. # on the oreilly bookshelf and may be at your
  8. # library. I'm only reprinting the code example
  9. # here because I'm working on this stuff as a
  10. # student of the Python Programming language.
  11. # Thanks Jesse Noller for such a good book.
  12.  
  13. import decimal
  14.  
  15. # Tuple
  16. t = (1, (1, 1), -2)
  17. print 'Input    :', t
  18. print 'Decimal  :', decimal.Decimal(t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement