Skip to content

Instantly share code, notes, and snippets.

@sheland
Last active August 7, 2018 21:13
Show Gist options
  • Select an option

  • Save sheland/cac1c4a691a52f84216ba79cca1972f1 to your computer and use it in GitHub Desktop.

Select an option

Save sheland/cac1c4a691a52f84216ba79cca1972f1 to your computer and use it in GitHub Desktop.
# Day 1 of Ada
# Types Practice Worksheet
# Evaluate values and data types
1. Value: 32 Data Type: Fixmun
2. Value: 6 Data Type: Fixmun
3. Value: 44 Data Type: String
4. Value: "dinosaur" "astronaut" Data Type: String
5. Value: 16 Data Type: Fixmun
6. Value: 9 Data Type: String
7. Value: 12.5 Data Type: Fixmun
8. Value: 12.5 Data Type: Float
9. Value: 6.5 Data Type: Float
10. Value: :dan Data Type: Symbol
11. Value: "Pikachu", "Bulbasaur", "Squirtle", "Charizard" Data Type: Array
12. Value: "Charizard" Data Type: Array
13. Value: "Bulbasaur" Data Type: Array
14. Value: 4 Data Type: Array
15. Value: "Pikachu" Data Type: Array
16. Value: nil Data Type: Array
17. Value: Charizard Data Type: Array
18. Value:
name: "Pikachu",
type: :electric,
species: "Mouse Pokemon",
height: 0.41,
weight: 6.0,
id: 25:
Data Type: Hash
19. Value: "Pikachu" Data Type: Hash
20. Value: 25 Data Type: Hash
Comprehension Questions
1. Given a variable list which is an array: 11-14
2. How would you print the last element of the array? print list.last
3. How about the first? print list.first
4. Compare and contrast arrays and hashes. How are they similar, and how do they differ?
Arrays are an ordered list of element, Hashes store key-pair values. Hashes are good when key values are the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment