STUCK loops and iterators- Ruby-"looks like you didnt print numbers 1 - 50 inclusive"

     i = 0
 while i < 50 do
   print i
   i += 1


Put the number of the lesson you are working on.


I figured it out sorry! Thank you :smile:


I am having a similar issue with "until"

Loops and Iterators.15

num = 1
until num == 50 do
print num
num += 1

says 1 to 50 is not inclusive ... I've looks at the examples and previous practice problems. Am I missing somethings? Thanks for help.

until num == 50

What happens when num contains 50?


Inclusive means your code should print 50. The code shown will not print 50 so it is "not inclusive". A good way to understand why this is the case is to try to step through in your head what will happen when i = 50 and the interpreter executes the line until num == 50.


So can you show me how to format this correctly, because apparently I have no idea how to move forward from here.


Your formatting is fine, your range is wrong. If you indent the 2 lines between do, end it will be easier to read. However, that will not change how your code works.