Skip to content

Instantly share code, notes, and snippets.

@troyleach
Last active August 29, 2015 14:13
Show Gist options
  • Save troyleach/881d756dfb78be90311b to your computer and use it in GitHub Desktop.
Save troyleach/881d756dfb78be90311b to your computer and use it in GitHub Desktop.
screencast 12
#screen cast 13
state_capitals = { "Colorado" => "Denver",
"Kentucky" => "Frankfort",
"Illinois" => "Springfield",
"Minnesota" => "Saint Paul",
"Mississippi" => "Jackson" }
puts "I can tell you the capital of any of these states:"
state_capitals.each { |key, _| puts key }
print "Pick a state you would like to know where the capital is: "
choice = gets.chomp.capitalize
puts "The capital of #{choice} is #{state_capitals[choice]}"
@markeban
Copy link

Well done 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment