Sunday, 8 September 2013

Accessing at index of for cicle

Accessing at index of for cicle

I have this code:
for i in words:
print i
that report 'hello' word for 3 times. Why if:
for i in words:
print i[0]
the report is 'h' word for 3 times and not 'hello' word for 1 times? I
should report 'hello' for one time.

No comments:

Post a Comment