Skip to content

Instantly share code, notes, and snippets.

@joel-extremo
Created September 15, 2018 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joel-extremo/0f434249f3f1bbd8927a1476a0b2567e to your computer and use it in GitHub Desktop.
Save joel-extremo/0f434249f3f1bbd8927a1476a0b2567e to your computer and use it in GitHub Desktop.
3.3: Data Structures
def fav_foods
food_array = []
3.times do
puts "Name a favorite food."
food_array << gets.chomp
end
puts "Your favorite foods are #{food_array.join(", ")}."
food_array.each { |food| puts "I like #{food} too!" }
p ";)"
end
fav_foods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment