'next' keyword loop exercise bug?


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


error does not match the instructions


I have the same issue


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


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

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


I have the same issue.


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


Me too :unamused:
Definitely not cool...


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


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


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


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