Created
June 20, 2018 23:31
-
-
Save tengiao/6c377aae720bc86f897652473215b18c to your computer and use it in GitHub Desktop.
CareerFoundry3_3_DataStructures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fav_foods | |
food_array = [] | |
3.times do | |
puts "Name a favourite food." | |
food_array << gets.chomp | |
end | |
p food_array | |
puts "Your favourite foods are #{food_array.join(", ")}." | |
food_array.each { |food| puts "I like #{food} too!" } | |
end | |
fav_foods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment