Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fav_foods
- food_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
- end
- 3.times do
- puts "Name a favorite food."
- food_array << gets.chomp
- puts "Your favorite foods are #{food_array.join("fav_foods")}."
- #Method fav_foods#
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement