This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Loops & Iterators Forum

View Course

366 points
52c5f9be7c82ca2ff8000ee6_300812423
Submitted by
Lotty
over 2 years ago

Looping with 'For': Numbers 1 to 50 not inclusive

I cannot get past the the Looping with 'For'. It keeps saying Oops, try again. It looks like you didn't print out the numbers 1 to 50, inclusive. even though it is printing 1 through 50.

This is my code:

for num in 1..50
    print num
end

Does anyone know why it won't pass?


2 votes

permalink

Okey. I found a solution. You need delete all until and while loops in your code and then submit only that for loop..

452 points
55a20b6f9376762ca200086c_666955976
Submitted by
Rami Inberg
over 2 years ago

1 Comment

52c5f9be7c82ca2ff8000ee6_300812423 Lotty over 2 years ago

ahh that's great, thank you :)


0 votes

permalink

I have same problem! :/

452 points
55a20b6f9376762ca200086c_666955976
Submitted by
Rami Inberg
over 2 years ago


0 votes

permalink

num = 1
while num <= 50
print num
num = num + 1
end

this is my resolve for that

237 points
Picture
Submitted by
Sky Cipri
about 2 years ago