#####(1) Instantiate a hash in two ways.
# your code here
#####(2) Store the following key-value pairs in your hash in two ways.
Key | Value |
---|---|
'Hitchcock' | ['Rear Window'] |
'Truffaut' | ['400 Blows'] |
'Myers' | ['Austin Powers', 'Shrek'] |
'fruit' | 'banana' |
# your code here.
#####(3) One these key-value pairs is not like the others. Delete it.
hash = {"Hitchcock"=>["Rear Window"], "Truffaut"=>["400 Blows"], "Myers"=>["Austin Powers", "Shrek"], "banana"=>"fruit"}
# your code here
#####(4) Add an element to the array accessible via the key 'Hitchcock'
hash = {"Hitchcock"=>["Rear Window"], "Truffaut"=>["400 Blows"], "Myers"=>["Austin Powers", "Shrek"]}
# your code here.
#####(5)
Remove 'Shrek' from the array accessible via the key 'Myers'
hash = {"Hitchcock"=>["Rear Window", "Birds"], "Truffaut"=>["400 Blows"], "Myers"=>["Austin Powers", "Shrek"]}
# your code here
#####(6) Return all of the keys associated with this hash.
hash = {"Hitchcock"=>["Rear Window", "Birds"], "Truffaut"=>["400 Blows"], "Myers"=>["Austin Powers"]}
# your code here
#####(7) Return all the values associated with this hash.
hash = {"Hitchcock"=>["Rear Window", "Birds"], "Truffaut"=>["400 Blows"], "Myers"=>["Austin Powers"]}
# your code here