Boolean result of divmod

Terry Reedy tjreedy at udel.edu
Mon Jun 20 21:35:13 EDT 2011


On 6/20/2011 8:28 PM, Gnarlodious wrote:
> What is the easiest way to get the first number as boolean?
>
> divmod(99.6, 30.1)
>
> Or do I have to say:
>
> flote, rem=divmod(99.6, 30.1)
> bool(flote)

divmod(x,y) == x//y, x%y

so bool(x//y)

-- 
Terry Jan Reedy




More information about the Python-list mailing list