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 Comparison Operators: Greater Than and Less Than

David Besserman
David Besserman
3,963 Points

why "a" > "b" doesn't check is "a" is bigger than "b"

I can't understand why

"a" > "b"

doesn't work as you did in the video

Can you please helm me ?

6 Answers

Philip Benton
Philip Benton
1,378 Points

Variables do not have quotations around them. "a" or "b" would be interpreted as strings which will throw and error.

Are you using quotation marks "a" > "b", if so , remove them :

a > b

Asa Smith
Asa Smith
10,009 Points

I had the same issue. The instructions tell you to check of the variable "a" is greater than "b". The video also shows checking the value of string "a" > string "b". Sort of confusing instruction.

David Besserman
David Besserman
3,963 Points

thanks Marc. That worked. But why wasn't "a" > "b" working ? isn't "a" or "b" a variable ? Or is it a error in the question ?

also a>b (without spaces) doesn't work in the challenge but it is valid and works in irb? Should this not also pass?

Philip Bessa
Philip Bessa
5,396 Points

It should pass, but generally it's not good form to type it without any spaces. It would be harder to read if there were a bunch of those crammed together in lines of code.