I want to use the traditional C-style for loop in Python. I want to loop through characters of a string, but also know what it is, and be able to jump through characters (e.g. i =5 somewhere in the code).
i =
for with range doesn't give me the flexibility of an actual for loop.
for
range
In C:
C
for(int i=0; i<9; i+=2) { dosomething(i); }
In python3:
python3
for i in range(0, 9, 2): dosomething(i)
You just express the same idea in different languages.
1.4m articles
1.4m replys
5 comments
57.0k users