In case you’re not picking up on the theme of Ruby having a gajillion ways to do any given task: let’s convert our loop yet again.

for k in 1..3 print k end

In the above example, we print out 123 by virtue of looping from 1 to 3 inclusive.



Now print out the numbers from 1 to 50 inclusive, using a for loop instead of an until loop.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?