Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 11:05:32 PM UTC+5:30, Peter Otten wrote: > Indeed. It's still better than > > "This is %s a fruit" % (x in x_list and "" or "not") > > The bug is intentional; the fix is of course > > "This is %s a fruit" % (x in x_list and "most likely" or "probably not") > > ;)

Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Peter Otten
Rustom Mody wrote: > On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote: >> Rustom Mody wrote: >> >> > Others have answered some parts >> if x in x_list: >> > ... print("That is a fruit.") >> > ... else: >> > ... print("That is not a fruit.") >> > ... >> > >> > How

Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote: > Rustom Mody wrote: > > > Others have answered some parts > if x in x_list: > > ... print("That is a fruit.") > > ... else: > > ... print("That is not a fruit.") > > ... > > > > However one can distribute the prin

Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Peter Otten
Rustom Mody wrote: > Others have answered some parts if x in x_list: > ... print("That is a fruit.") > ... else: > ... print("That is not a fruit.") > ... > > However one can distribute the print out of the if; Thus > "This is %s a fruit" % ("" if x in x_list else "not") Which