Skip to content

Instantly share code, notes, and snippets.

@mcsuth
Forked from tmehta2442/contactlist.rb
Created September 26, 2013 00:32
Show Gist options
  • Save mcsuth/6708219 to your computer and use it in GitHub Desktop.
Save mcsuth/6708219 to your computer and use it in GitHub Desktop.
puts "would you lke to start a contact list?"
response = gets.chomp
hash = {}
while response == "y"
puts "give me name"
name = gets.chomp
puts "number"
number = gets.chomp
hash[name] = number
puts "continue? y/n"
response = gets.chomp
while response != "y" && response != "n"
puts "enter y/n"
response = gets.chomp
end
end
print hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment