[Tutor] for loop

R. Alan Monroe amonroe at columbus.rr.com
Fri Apr 17 03:24:37 CEST 2009



>>>> for letter in "python":
>  print "Current letter:", letter

>>>> for chic in "python":
>  print "chic:", chic

When you write a for-in loop, you can use any variable name you feel
like using (letter, chic, mycoolvariable, x, etc.) It's that simple :)

Alan



More information about the Tutor mailing list