The combined comparison operator


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

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

1 Like

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