Quick question:


Hello, I got a quick question, in the "for loop" is the word right next to the word "for" (see example below) defined?
In the code I don't see "number" being defined at all, so how does python know what I mean?
I'm confused...

my_list = [1,9,3,8,5,7]

for number in my_list:
    print 2 * number


It is defined by for. It does not need any previous definition.


I see now, thank you.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.