14. Looping with 'while'


#1



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


it says
Oops, try again.
It looks like you didn't print out the numbers 1 to 50, inclusive.
Didn't I do that


i = 1
while i < 51 do
    puts i
    i += 1
end


#2

Use print rather than puts

Your output will occupy the same line.


#3

Oh wait. The next one I have a problem with too.

i = 1
until i == 50 do
print i
i += 1
end


#4

What is the error message?


#5

It's the same as last time.


#6

This will end on 49. Try,

until i  > 50

#7

Thanks it worked once more.


#8

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