Re: Boolean result of divmod

2011-06-20 Thread Terry Reedy
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 -- http://mail.python.org/mailman/listinfo/pytho

Re: Boolean result of divmod

2011-06-20 Thread MRAB
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]) -- http://mail.python.org/mailman/listinfo/python

Re: Boolean result of divmod

2011-06-20 Thread Chris Torek
In article <261fc85a-ca6b-4520-93ed-27e78bc21...@y30g2000yqb.googlegroups.com> Gnarlodious wrote: >What is the easiest way to get the first number as boolean? > >divmod(99.6, 30.1) divmod returns a 2-tuple: >>> divmod(99.6,30.1) (3.0, 9.2901) Therefore, you can subscript th

Boolean result of divmod

2011-06-20 Thread Gnarlodious
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) -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-list