Fundamentals8 / 16
Up next

case / when

grade = 85
# when clauses can hold ranges
result = case grade
         when 90.. then "A"
         when 80...90 then "B"
         else "C"
         end
puts result
What you're solving

match a value against patterns