#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2009 Doug Hellmann All rights reserved. # """ """ #end_pymotw_header import fractions for n, d in [ (1, 2), (2, 4), (3, 6) ]: f = fractions.Fraction(n, d) print '%s/%s = %s' % (n, d, f)