This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Lotty
over 8 years

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?

Answer 55a20a7e76b8fe2a3f0007fe

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..

points
Submitted by Rami Inberg
over 8 years

1 comments

Lotty over 8 years

ahh that’s great, thank you :)

Answer 55a20874e39efeed9f00039b

0 votes

Permalink

I have same problem! :/

points
Submitted by Rami Inberg
over 8 years

Answer 5603db3551b8876b91000414

0 votes

Permalink

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

this is my resolve for that

points
Submitted by Sky Cipri
over 8 years