Stuck on 2. Danger: Infinite Loops!


#1

Hi Guys,

I am so stuck with even starting Loops & iterators. Can anyone help me on the 2. Danger: Infinite Loops! :expressionless:

i = 0
while i < 5
puts i
# Add your code here!

end

Any help would just be amazing so I don't struggle on this whole section!

The instructions for this are below:

The while loop in the editor is currently an infinite loop. Correct it so it will end! (Be careful—if you click Save & Submit Code right away, you'll start the infinite loop and you'll have to refresh the page.)


#2

HI its missing the increment of i

i += 1
or
i = i + 1

put it jus after the

# Add your code here!

#3

Thank you so much! Jeez so obvious!!! I've been coding all day on this so maybe my brain is mush.