Boolean result of divmod

MRAB python at mrabarnett.plus.com
Mon Jun 20 20:45:40 EDT 2011


On 21/06/2011 01:28, 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 returns a tuple, so:

     bool(divmod(99.6, 30.1)[0])



More information about the Python-list mailing list