Skip to content

Instantly share code, notes, and snippets.

@themonster2015
Last active February 27, 2017 21:51
Show Gist options
  • Save themonster2015/f661e1fc78d0e8ba7f011409029e30be to your computer and use it in GitHub Desktop.
Save themonster2015/f661e1fc78d0e8ba7f011409029e30be to your computer and use it in GitHub Desktop.
def fav_foods
food_array = []
3.times do
puts "Name a favorite food."
food_array << gets.chomp
puts "Your favorite foods are #{food_array.join(", ")}."
food_array.each { |food| puts "Seriously? I really love #{food} too!"}
array.push("Mango")
array.pop
array.reverse!
array_sorted = array.sort
end
end
fav_foods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment