Having both if() and for() statements in one liner

Joshua Landau joshua at landau.ws
Wed Sep 18 01:55:42 EDT 2013


On 18 September 2013 03:10, Steven D'Aprano <steve at pearwood.info> wrote:
> On Tue, 17 Sep 2013 18:54:51 +0000, Dave Angel wrote:
>
>> for times in range(0, 5 if person=="George" else 0):
>
>
> Oh that is evil. Truly evil.
>
> Thank you, I will treasure that piece of code forever.

range(person == "simon" and 5)



More information about the Python-list mailing list