Created
October 1, 2014 00:22
-
-
Save elskwid/570b77b1fc7d07125fc1 to your computer and use it in GitHub Desktop.
exercise4
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
# Remember: use `ruby exercise4.rb` to run this file | |
# 1. display the contents of the `my_variable` variable | |
my_variable = "100" | |
# 2. assign the integer 5 to a variable named 'number' | |
# 3. display the contents of the 'number' variable | |
# 4. create an array with the values 1, 2, 4, and 5, assign it to a variable named `numbers` | |
# 5. Add your name to the end of the array | |
# 6. display the contents of the array at index 3 | |
# 7. display array element (contents) at index 8 | |
# 8. create an array of hashes of some of the names of people in the class | |
# { "name" => "Don" }, { "name" => "Phil" }, etc | |
# 9. use `each` to display the key and value for each member of the hash | |
# 10. change the display of the hash to say: | |
# "The name of this person is: 'Don', and so on... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment