On May 12, 12:18 pm, "Cesar G. Miguel" <[EMAIL PROTECTED]> wrote: > 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
What is your real intent here? This is how I understand it after reading your post: you want to create a loop that steps by an increment of 2. If that's the case, then: >>> for j in range(0,10,2): ... print j ... 0 2 4 6 8 would be a simple result. Cheers, -Basilisk96 -- http://mail.python.org/mailman/listinfo/python-list