Advertisement
rfmonk

fractions_create_strings_floats.py

Jan 22nd, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import fractions
  5.  
  6. for s in ['0.5', '1.5', '2.0']:
  7.     f = fractions.Fraction(s)
  8.     print '%s = %s' % (s, f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement