I am having a doubt that like other programming languages we can increment in for loop as we want (eg in c for(i=0; i<5;i+5)) but if we want to do his in python we cant ??????
Asked
Active
Viewed 643 times
0
-
`range` can get a step. Also, your loop would run indefinitely because you wrote `i+5`, not `i=i+5` nor `i+=5`. – h4z3 Jul 22 '19 at 14:00
-
Duplicate of https://stackoverflow.com/questions/434287/what-is-the-most-pythonic-way-to-iterate-over-a-list-in-chunks – Frieder Jul 22 '19 at 14:02
-
Possible duplicate of [To write a java for loop in python](https://stackoverflow.com/questions/52906665/to-write-a-java-for-loop-in-python) – Dmytro Chasovskyi Jul 22 '19 at 14:29
-
Possible duplicate of [What is the most "pythonic" way to iterate over a list in chunks?](https://stackoverflow.com/questions/434287/what-is-the-most-pythonic-way-to-iterate-over-a-list-in-chunks) – Valentino Jul 22 '19 at 14:39