'next' keyword loop exercise bug?


#1

when I run the code, it says I did not print out number 0 - 18 but that is not the instructions

https://www.codecademy.com/en/courses/ruby-beginner-en-XYcN1/2/2?curriculum_id=5059f8619189a5000201fbcb

error does not match the instructions


#2

I have the same issue


#3

There are other bugs for me it just says you have an infinite loop and fails to run THE DEFAULT CODE!


#4

Are you running this code?
next if i % 1 == 0

The answer is:next if i%2==1


#5

I have the same issue.


#6

Same here....... stuck.... what should we do?


#7

Me too :unamused:
Definitely not cool...


#8

Fixed it, the nums should be all in one line l


#9

I am using the same thing and all nums are in same line. I am using print statement and it's not working
. Can you please help me out


#10

Use the next keyword so that you skip to the next iteration if the number i is odd.
It means you don't want 19 17 15 etc
Try this :

i = 19
loop do
i -= 1
next if i % 2 == 1
print i
break if i <= 0
end


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.