-
-
Save mistyrinth/cc0bd335004dda9d1a87178b6c49f72b to your computer and use it in GitHub Desktop.
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
hash = {"りんご" => "apple", "みかん" => "orange", "ぶどう" => "grape"} | |
# keysメソッド | |
key_array = hash.keys | |
print(key_array, "\n") | |
# valuesメソッド | |
value_array = hash.values | |
print(value_array, "\n") | |
# to_aメソッド | |
array = hash.to_a | |
print(array, "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment