Why am I getting syntax errors, yet it's moving on to the next task?


#1



https://www.codecademy.com/courses/ruby-beginner-en-NFCZ7/1/1?curriculum_id=5059f8619189a5000201fbcb

(ruby):4: syntax error, unexpected keyword_end, expecting $end


is_true = 2 == 3
    print "2 equals 3"
is_false = 2 != 3
    print "2 doesn't equal 3"
end


#2

Hi Karl :slight_smile:

Why do you have the end keyword at the end of your code? It is only used to end blocks of code like in if statements, loops, methods, etc.


#3

as gaurangtandon mentioned, you don't need 'end' in this case, that throws the syntax error. As for why its moving on, that is because the part the checks whether to go to next task checks if the output/result is they asked of you, which it is. that end confuses the computer, but only after it has printed out what the excercise wanted you to print out.