Quick question:


#1

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

#2

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


#3

I see now, thank you.


#4

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