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

Steven D'Aprano steve at pearwood.info
Tue Sep 17 22:10:56 EDT 2013


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.


-- 
Steven



More information about the Python-list mailing list