A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/088087.html below:

Conditional operator in Python?

Conditional operator in Python? Conditional operator in Python?Rainer Deyke root at rainerdeyke.com
Sun Apr 1 00:02:38 EST 2001
"Emile van Sebille" <emile at fenx.com> wrote in message
news:9a631k$3s8qb$1 at ID-11957.news.dfncis.de...
> Yes, it comes up.  Generally, except for short-circuiting, the solutions
> follow:
>
> >>> 1 and 2 or 3
> 2
> >>> 0 and 2 or 3
> 3

This is not equivalent in the general case.

0 ? 0 : 1    --> 0
0 and 0 or 1 --> 1


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4