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 Operators and Control Structures Ruby Operators Less Than Or Equal To

i do not understand

Use the less than or equal to operator to determine whether or not the variable "b" is less than or equal to the variable "a".

b >= a 

4 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi John, you used the greater than or equal to sign (>=) in your comparison when it requires you to use less than or equal to (<=), like so:

b <= a 

Below I have included the most common Ruby Comparison Operators if you need to refer to them:

  • < less than
  • > greater than
  • <= less than or equal to
  • >= greater than or equal to
  • == equal value
  • != not equal value

Hope that helps!!

Bruce Canedy
Bruce Canedy
13,496 Points

so you looking to determine if a variable is less than or equal.

b<a would validate if b less than a b=a would validate if b equal a

so,

b <= a would validated if b less than or equal to a

George Nono
George Nono
11,256 Points

I got the answer right by typing in:

b < a

Which isn't correct. From what the video says it should be :

"b" < "a"

I typed in: b < a and it said it was wrong, so I opened up my note pad on my Mac and typed it there and copy/paste and it worked. Has to be a bug.