Advertisement
Guest User

Untitled

a guest
May 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. list = {'yvr' => 'Vancouver', 'yba' => 'Banff', 'yyz' => 'Toronto', 'yxx' => 'Abbotsford', 'ybw' => 'Calgary'}
  2.  
  3. # Why is it returning nil instead of first element of the list above?
  4.  
  5. # A: It is not calling a proper key as 'list' is a hash, not an array
  6. p list['yvr']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement