Skip to content

Instantly share code, notes, and snippets.

@elskwid
Created October 1, 2014 00:22
Show Gist options
  • Save elskwid/570b77b1fc7d07125fc1 to your computer and use it in GitHub Desktop.
Save elskwid/570b77b1fc7d07125fc1 to your computer and use it in GitHub Desktop.
exercise4
# 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