title: Why do I get a syntax error using the ternary operator?
body: <p>I wrote an if-then-else program, but when changing the code to use the ternary operator I am getting a syntax error and cannot figure out why it will not work:</p>
  
  <pre><code>def are_you_over_21
    puts"How old are you?"
    age = gets.chomp.to_i
    age&gt;=21 ? puts"You're over 21!" : puts"You're too young."
  end
  
  are_you_over_21
  </code></pre>