[Tutor] for loop

mbikinyi brat mbikinyi_brat at yahoo.com
Thu Apr 16 22:45:23 CEST 2009

Dear ALL,
I am a beginner in python and I just copied the code in blue below and execute and had the result in green. Then I thought letter should be a special word in python. Then I now replace letter whith chic  and yet the same results is obtained. I cannot reconcile them. Can someone explained to me please?
>>> for letter in "python":
 print "Current letter:", letter
Current letter: p
Current letter: y
Current letter: t
Current letter: h
Current letter: o
Current letter: n
>>> for chic in "python":
 print "chic:", chic
chic: p
chic: y
chic: t
chic: h
chic: o
chic: n


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090416/b3ae238b/attachment.htm>

More information about the Tutor mailing list