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.
You can do the following, given an array a:
for i in range(len(a)):
a[i] = i
That's the closest Python can get to C-style loops.
You can also give the range
command more arguments; for example,
for i in range(2, len(a), 3)
will start at i = 2, and increment it by 3 as long as the result is less than len(a).