Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> Michael >>
> >> Does Python 2.4 support it?
> >
> > Not precisely, but you can *usually* get away with:
> >
> > a and b or c
>
> This is really bad advice, as long as you don't explain why it "usually"
> works (and often enough not). This for exam
Michael >>
>> Does Python 2.4 support it?
>
> Not precisely, but you can *usually* get away with:
>
> a and b or c
This is really bad advice, as long as you don't explain why it "usually"
works (and often enough not). This for example won't work:
>>> False or '' and 0
''
The reason is that the
On Apr 25, 2007, at 1:58 AM, Alchemist wrote:
> What is Python's version for the trinary if..then..else operator?
>
> I want a one-liner such as
> a?b:c
> for the if..then..else control structure
> if a
> then b
> else c
>
> Does Python 2.4 support it?
Not precisely, but you can *usually*
Alchemist wrote:
> What is Python's version for the trinary if..then..else operator?
true_value if condition else false_value
> Does Python 2.4 support it?
No, it requires 2.5 or later.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
What is Python's version for the trinary if..then..else operator?
I want a one-liner such as
a?b:c
for the if..then..else control structure
if a
then b
else c
Does Python 2.4 support it?
--
http://mail.python.org/mailman/listinfo/python-list