Looping with for! 5.16 ! HELP please :)



"Oops, try again. It looks like you didn't print out the numbers 1 to 50, inclusive."

This is the result I keep getting: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950111111111111111111111111111111111111111111111111111..50

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

a = 1
until a <= 50 do
    print a
    a += 1

for c in 1..50
   print c


You only need 1 loop to pass. It is pretty much your for loop with some touches:

for k in 1..50 do 
   print k

That's all you need.


Thanks boss for the help.


Could you mark my answer as the solution? It's a check mark button by the like button. :laughing:


I dont know if that's the solution lol. I just deleted the other loops, in the codeacademy lesson plan though I haven't seen a do in a for loop.


No problem... :smirk: It's kinda just so people know that you solved it and they don't have to click on it...


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