Advertisement
rfmonk

fractions_create_integers.py

Jan 22nd, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. import fractions
  2.  
  3. for n, d in [(1, 2), (2, 4), (3, 6)]:
  4.     f = fractions.Fraction(n, d)
  5.     print '%s/%s = %s' % (n, d, f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement