0

I know that python has a for-in loop - which is kind of like a for-each iterator over strings and lists.

But does python support plain old for loop [POFL] like C or java has:

for(initialize;conditional;increment):
 body of for loop
5
  • No, not directly, but why would you need that ? Commented Dec 21, 2015 at 6:21
  • just like that, I saw a few implementations like this: Commented Dec 21, 2015 at 6:21
  • for (i in range(list or string)) Commented Dec 21, 2015 at 6:22
  • You could use a list comprehension with for loop here Commented Dec 21, 2015 at 6:22
  • also see enumerate Commented Dec 21, 2015 at 6:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.