Basic question

Cesar G. Miguel cesar.gomes at gmail.com
Sat May 12 12:18:06 EDT 2007


I've been studying python for 2 weeks now and got stucked in the
following problem:

for j in range(10):
  print j
  if(True):
       j=j+2
       print 'interno',j

What happens is that "j=j+2" inside IF does not change the loop
counter ("j") as it would in C or Java, for example.

Am I missing something?

[]'s
Cesar




More information about the Python-list mailing list