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.

Endless loop in C/C++

There are several possibilities to do an endless loop, here are a few I would choose: for(;;) {} while(1) {} / while(true) {} …

c++ c loops infinite-loop
Iterate through pairs of items in a Python list

Possible Duplicates: Iterate a list as pair (current, next) in Python Iterating over every two elements in a list Is …

python list loops
How to break out of a loop from inside a switch?

I'm writing some code that looks like this: while(true) { switch(msg->state) { case MSGTYPE: // ... break; // ... more stuff ... case …

c++ loops syntax switch-statement break
Creating an array from a text file in Bash

A script takes a URL, parses it for the required fields, and redirects its output to be saved in a …

arrays bash loops scripting variable-assignment
Skip over a value in the range function in python

What is the pythonic way of looping through a range of numbers and skipping over one value? For example, the …

python loops for-loop range
More Pythonic Way to Run a Process X Times

Which is more pythonic? While loop: count = 0 while count < 50: print "Some thing" count = count + 1 For loop: for i in …

python loops
how to write an array to a file Java

I have been trying to write an array to a file. I know how to write integers or String to …

java arrays file loops bufferedwriter
Object does not support item assignment error

In my views.py I assign values before saving the form. I used to do it the following way: projectForm.…

python django loops dictionary
How to get out of while loop in java with Scanner method "hasNext" as condition?

I am a beginner at java programming and has run into a strange issue. Below is my code, which asks …

java loops while-loop infinite-loop
Loop through a Map with JSTL

I'm looking to have JSTL loop through a Map<String, String> and output the value of the key …

map loops jstl