Ruby Ruby Basics Conditionals Comparison Operators

Alonso Martinez
Alonso Martinez
6,975 Points

Comparison Operators

Im stuck here... not sure what I'm doing wrong

program.rb
if number 2 < 3 
  puts "{number}"

end 

1 Answer

Antonio De Rose
Antonio De Rose
20,852 Points

actually, you have not been asked to compare a variable in the name of number, instead you've been asked to compare the numbers directly, that's why the hint (We know, it is, but see if you can express that in code.) , had been given in the question.

if you can recall, how the teacher, uses opening the workspace, and launching irb, and then issuing commands, the same way, is what had been asked to achieve it.

you could finish, in 2 simple lines, one to check 2 < 3, the other to check 5 > 6, to present the outcome, you have to use puts.

Alonso Martinez
Alonso Martinez
6,975 Points

Thank you. I actually finished before I read this answer and slapped myself lol. I'm too tired to code after work.. probably need some coffee