You could simplify this to: puts "Which line are you on #{subway.keys}"