The combined comparison operator


#1

Hey,

I am at the combined comparison operator bit and this is my code:

book_1 = “A Wrinkle in Time”

book_2 = “A Brief History of Time”

puts book_1 <=> book_2

the result in the console is 1

and I get this error message:

It looks like your comparison doesn’t return the correct value (1). Did you remember to compare book_1 <=> book_2 (in that order)?

any help would be great.thanks


#2

Ok so I shouldn’t have added puts
it works with book_1 <=> book_2


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.