PEP 308: ternary operator

phil hunt philh at cabalamat.uklinux.net
Fri Feb 21 08:50:55 EST 2003


On Thu, 20 Feb 2003 22:02:51 GMT, Raymond Hettinger <vze4rx4y at verizon.net> wrote:
>> "Terry Hancock" <hancock at anansispaceworks.com> wrote:
>> > 1) Is it <cond>? <a>:<b> or <cond>: <a>?<b>
>> > I can never remember this!
>>
>> <a> and <b> are answers, <cond> is the question.
>> The question is followed by a question mark.
>>
>> Quite logical, actually.
>>
>> - Anders
>
>Also, the use of c?a:b in other languages is an important
>consideration so that skills are transferrable both to and
>from Python.   That syntax is used in enough other places
>to make it a valuable thing to know.

Does anyone have an estimate of the proportion of Python programmers
who know at least one C-syntax language? My guess is that at least
66% of us do.

-- 
|*|  Philip Hunt <philh at cabalamat.uklinux.net>   |*|
|*|  "Memes are a hoax; pass it on"              |*|





More information about the Python-list mailing list