can I modify range()
during for loop?
for i in range(10):
if something:
pass
# change range
print(i)
An example:
Let method something
be i == 5
and the body will decrease range by one.
Expected output:
0
1
2
3
4
5
5
6
7
8
9
I have a little more complex range()
like range(0, len(data), 1024)
.
Thanks for any help!