Forgetting "()" when calling methods
Lulu of the Lotus-Eaters
mertz at gnosis.cx
Sun Apr 27 22:30:00 EDT 2003
"Terry Reedy" <tjreedy at udel.edu> wrote previously:
|At one time, it was easy for anyone to get 100% on a quiz like 'how
|many of the following lists can Python sort?". Now, even some
|experienced users, might miss the correct answer for the following
|pair (0, 1, or 2?):
[1, 1j].sort()
['1', 1j].sort()
And to be even trickier, answer the question for the following lists:
[u'x', 'x', chr(255)].sort()
['x', chr(255), u'x'].sort()
[1j, '1', 1].sort()
[1, 1j, '1'].sort()
Then try to explain the answer to ANYONE you know.
--
_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: Postmodern Enterprises _/_/_/
_/_/ ~~~~~~~~~~~~~~~~~~~~[mertz at gnosis.cx]~~~~~~~~~~~~~~~~~~~~~ _/_/
_/_/ The opinions expressed here must be those of my employer... _/_/
_/_/_/_/_/_/_/_/_/_/ Surely you don't think that *I* believe them! _/_/
More information about the Python-list
mailing list