Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

help

Using a while loop, increment the value of the variable i as long as it remains less than 5.

my code:

i = 0 while i < 5 begin

http://teamtreehouse.com/library/ruby-loops/ruby-loops/the-while-loop-2

1 Answer

I'm not sure what your keyword begin is expected to do, but the passing code looks like this:

i = 0

while i < 5
  i += 1
end

Please rewatch the video to fully understand how this works.