diveintopython
diveintopython copied to clipboard
Typo in example 4.18 (and-or trick)
Since a is an empty string, which Python considers false in a boolean context, 1
and ''
evalutes to ''
, and then ''
or 'second'
evalutes to 'second'
. Oops! That's not what you wanted.
It actually occurs a few times on that page.