If it is not a zero, then
op = 0 if !op.zero? # not a zero? puts 12 / op else puts "Can't divide by zero." end