Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_list
- print "what is the list name? "
- name = gets.chomp
- hash = {"name" => name, "items" => Array.new}
- return hash
- end
- def add_list_item
- print "what is the item called?"
- item_name = gets.chomp
- print "How Much? "
- quantity = gets.chomp.to_i
- hash = {"name" => item_name, "quantity" => quantity[]}
- return hash
- end
- list = create_list()
- puts list.inspect
- puts add_list_item().inspect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement