<p dir="ltr"><br>
On Jun 14, 2013 9:34 AM, "Michael Torrie" <<a href="mailto:torriem@gmail.com">torriem@gmail.com</a>> wrote:<br>
><br>
> On 06/14/2013 03:50 AM, Nick the Gr33k wrote:<br>
> >  >>> print(name or month or year)<br>
> > abcd<br>
> >  >>> print(name and month and year)<br>
> > ijkl<br>
><br>
> Interesting.  I'd have thought a boolean expression would return True or<br>
> False, not a string.  Learn something new every day.<br>
><br>
><br>
></p>
<p dir="ltr">Python didn't have a Boolean type for quite some time (2.2?). Until then, True and False were ints. Since every object had a Boolean value, you didn't need to turn the result into an integer. In an "and" clause, python returns the first false value or the last value, because that will evaluate to the correct Boolean value. In an "or" clause, python returns the first true value or the last value. When Python finally got a Boolean type, no one wanted to break backwards compatibility for this.<br>

</p>