If you want your input to be downcased, you could do: response = gets.chomp.downcase to ensure all input are downcased. That way you would not have to compare the response to 'Q'.downcase. You could have used 'q' instead of 'Q'.downcase as well.