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

Ferrous Cranus nikos.gr33k at gmail.com
Tue Sep 17 08:02:56 EDT 2013


o want to avoid having to type somehting like this:

if person="George":
	times in range(0, 5):


Why it gives me an error when i'm trying to write it like this:


if person="George" for times in range(0, 5):

Can't i ahve both if and for in a one liner?



More information about the Python-list mailing list