sorting

Jason Orendorff jason at jorendorff.com
Thu Feb 28 12:29:18 EST 2002


Really cool explanation by Carel, but a few things should
be fixed:

>    >>> numbers = [ real(x) for x in number_strings ]

float(x), not real(x).

>    >>> print "the number %r occured %d time(s)" % (78, count[78]))

Instead of %r, you want %s.  There are lots of different
possible formats (you can specify exactly how many decimal places
you want, etc.) but I think %s is the most friendly.

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list