Bug or something on Zen of Ruby 4/20 "One Good Turn deserves a Ternary."

I’m going through this exercise and something funny is happening on this one. I can’t tell if it’s codeacademy, or I’m not getting something. Here’s my code:

puts cheese ? “Cheese is good” : “Cheese is bad”

puts true ? “True” : “False”

puts 3 < 4 ? “3 is less than four” : “three is not less than four”

The strange part is that the Ruby console evaluates the cheese part of the code as false. No matter what I put, it still evaluates to “Cheese is bad.” I’m confused. The other two evaluate correctly.

cheese is undefined. For it to work it should be “cheese”. In quotes.

I’m back at Control Flow: 5/17 Unless - here’s the sample code:

hungry = false

unless hungry
puts “I’m writing Ruby programs!”
puts “Time to eat!”

When you type
cheese == true
you’re asking if cheese is true. Remember == is a comparison symbol, like < ,>, <=, and >=.

What you want to do is assert that cheese is true by assigning it’s value as true with a single = symbol.

So, instead of asking, “is cheese true?” in the first line, you need to tell Ruby that cheese is true like this

cheese = true