Stuck on counting from 1 to 50


#1

please help. I am stuck on this same one.
I am trying the following code and it counts starting at 1 and goes up in increments of 1 until it hits 50

here is my code
i= 1
while 1 <= 50
print i
i +=1
end


Ruby Looping with "While"
#2

Which exercise is this? Please post a link. Thanks.


#3

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


#4

I really appreciate the help. please let me know if there is anything else I need to provide. I believe I have it all included though.

Stephen


#5

Instructions

Use a while loop to print out the numbers 1 through 50, inclusive. While the example above counts down, you will want to count up.

Use print rather than puts, and don't forget to increment your variable.

Your code has a number, 1, where it should have, i.

while i <= 50

end

#6

thanks! Dyslexia is making this so dang hard for me haha. Thank you so much!!!


#7

I know where you are coming from. Spent a lifetime overcoming and compensating for that challenge. Things just take longer, and require constant rechecking. At the end of the day, we can still learn right along with the rest. Personally, I think that people who live with challenges in their lives end up stronger for it, and perhaps a little more empathetic than the next guy.


#8

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