G
Grzegorz Dostatni
Consider the following fragment:
.... for i in (1,2,3):
.... print i,
.... print i,
....
1 2 3 3 1 2 3 3 1 2 3 3
Now. I believe I know what is happening. The i in both loops refers to the
same variable. My question is whether it would make more sense (be more
intuitive) to have a for loop create its own local scope. (ie. an output
string of
1 2 3 a 1 2 3 b 1 2 3 c
)
Grzegorz
"Some cause happiness wherever they go; others, whenever they go."
- Oscar Wilde (1854-1900)
.... for i in (1,2,3):
.... print i,
.... print i,
....
1 2 3 3 1 2 3 3 1 2 3 3
Now. I believe I know what is happening. The i in both loops refers to the
same variable. My question is whether it would make more sense (be more
intuitive) to have a for loop create its own local scope. (ie. an output
string of
1 2 3 a 1 2 3 b 1 2 3 c
)
Grzegorz
"Some cause happiness wherever they go; others, whenever they go."
- Oscar Wilde (1854-1900)