Find an Online Tutor Now

4 Answered Questions for the topic loops

Loops Ruby Iteration


In Ruby, how do I skip a loop in a .each loop, similar to 'continue'?

In Ruby, how do I skip a loop in a `.each` loop, similar to `continue` in other languages?
Loops Logic Php


How to perform an action every 5 results?

How can I perform an action within a `for` loop every 5 results? Basically I'm just trying to emulate a table with 5 columns.
Loops Python List


Accessing the index in 'for' loops?

How do I access the index itself for a list like the following? ints = [8, 23, 45, 12, 78]When I loop through it using a `for` loop, how do I access the loop index, from 1 to 5 in this case?
Loops Ruby Arrays


What is the "right" way to iterate through an array in Ruby?

PHP, for all its warts, is pretty good on this count. There's no difference between an array and a hash (maybe I'm naive, but this seems obviously right to me), and to iterate through either you... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.