The following code
lst = ['foo', 'bar', 'baz']
for lst in lst:
print lst
gives me this output
foo
bar
baz
I would expect either an error or the following output:
['foo', 'bar', 'baz']
['foo', 'bar', 'baz']
['foo', 'bar', 'baz']
The code above is wrong and should have been
lst = ['foo', 'bar', 'baz']
for lst_element in lst:
print lst_element
Why is it, that python
although yields the expected output?