On 24 July 2010 22:29, Burcin Erocal wrote:
> Hi,
>
> At Sage Days 24, I learned that Python allows the user to do arithmetic
> with bools:
>
> In [1]: 5+True
> Out[1]: 6
I personally don't see anything wrong with that - True has long since
been defined as 1 in most languages, and False as 0.
I
On Sat, Jul 24, 2010 at 2:29 PM, Burcin Erocal wrote:
> Hi,
>
> At Sage Days 24, I learned that Python allows the user to do arithmetic
> with bools:
>
> In [1]: 5+True
> Out[1]: 6
>
> In [2]: True + False
> Out[2]: 1
>
> In [3]: 5+False
> Out[3]: 5
>
> Sage seems to follow this convention as well
On Sat, Jul 24, 2010 at 2:29 PM, Burcin Erocal wrote:
> Hi,
>
> At Sage Days 24, I learned that Python allows the user to do arithmetic
> with bools:
>
> In [1]: 5+True
> Out[1]: 6
>
> In [2]: True + False
> Out[2]: 1
>
> In [3]: 5+False
> Out[3]: 5
>
> Sage seems to follow this convention as well