Top "Loops" questions

Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.

How to retry after exception?

I have a loop starting with for i in range(0, 100). Normally it runs correctly, but sometimes it fails due to …

python loops exception try-except
Iterating over a 2 dimensional python list

I have created a 2 dimension array like: rows =3 columns= 2 mylist = [[0 for x in range(columns)] for x in range(rows)] …

python loops multidimensional-array
Iterating over all the keys of a map

Is there a way to get a list of all the keys in a Go language map? The number of …

loops dictionary go
Looping through array and removing items, without breaking for loop

I have the following for loop, and when I use splice() to remove an item, I then get that 'seconds' …

javascript loops
How can I loop through all rows of a table? (MySQL)

I have a table A and there is one primary key ID. Now I want to go through all rows …

mysql loops
Can you 'exit' a loop in PHP?

I have a loop that is doing some error checking in my PHP code. Originally it looked something like this... …

php loops
What's the best way to break from nested loops in JavaScript?

What's the best way to break from nested loops in Javascript? //Write the links to the page. for (var x = 0; …

javascript loops nested-loops break
Is there a "do ... while" loop in Ruby?

I'm using this code to let the user enter in names while the program stores them in an array until …

ruby loops
How to make for loops in Java increase by increments other than 1

If you have a for loop like this: for(j = 0; j<=90; j++){} It works fine. But when you have …

java loops for-loop
How to write loop in a Makefile?

I want to execute the following commands: ./a.out 1 ./a.out 2 ./a.out 3 ./a.out 4 . . . and so on How to …

makefile loops