Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Basics Conditionals Comparison Operators

Alonso Martinez
Alonso Martinez
8,442 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,885 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
8,442 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