In C++ or Java we can define indexes in loop like :
for(int i = 5 <---; i < array.size(); i++)
for(j = i + 1 <---....)
I am newbie in Python and can we impelement the same as above in python?
-
This is a duplicate. Take a look here https://stackoverflow.com/questions/4170656/for-loop-in-pythonCarlo Zanocco– Carlo Zanocco2020年09月05日 09:41:33 +00:00Commented Sep 5, 2020 at 9:41
2 Answers 2
for i in range(5, len(array)):
for j in range(i+1, ...):
rest of code
answered Sep 5, 2020 at 9:40
IoaTzimas
10.7k2 gold badges15 silver badges32 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
for i in range(5, len(array)):
for j in range(i + 1, ...)):
...
answered Sep 5, 2020 at 9:40
Jiří Baum
6,9882 gold badges19 silver badges19 bronze badges
Comments
lang-py