Created
June 10, 2013 20:13
-
-
Save chhhris/5751865 to your computer and use it in GitHub Desktop.
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
# Construct an array with your favorite foods. It should have at least 5 elements. | |
fav_foods = ["penne pasta with garlic and oil", "yellow cherries", "milk shakes", "french fries", "bacon cheeseburgers"] | |
# Write a puts which returns your most favorite food out of the array. | |
fav_foods[4] | |
# Construct an array with the colors of the rainbow (ROYGBIV) | |
rainbow = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"] | |
# Slice the colors Red, Orange, and Yellow out of the array. | |
rainbow[0, 3] | |
# Create an empty array. | |
empty = [""] | |
# Assign values to the the second and 6th position. | |
empty[1] = "Tacos" | |
empty[5] = "Fajitas" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment