Binary

Jerry Hill malaclypse2 at gmail.com
Fri Jun 8 11:34:18 EDT 2007


On 6/8/07, Brain Murphy <brianomorchoe at yahoo.co.uk> wrote:
> I need it to show the remainder. like remainder 1 or 0 the put all of them
> in a list that is backwards.

Take a look at the divmod() function.  It take the numerator and
denominator and returns a tuple of the quotient and remainder.  For
example:
>>> divmod(5, 2)
(2, 1)
>>> divmod(6, 2)
(3, 0)
>>>

-- 
Jerry



More information about the Python-list mailing list