Skip to main content

Dictionary.get

getkeyif_missing

Documentation

Gets the value associated with key in this dictionary, or returns if_missing if it isn't present. This method has a constant time complexity.

Arguments

  • key: The key to look up in the dictionary.
  • if_missing: The value to use if the key isn't present.

Examples

Get the value for the key 2 in a dictionary or instead return "zero" if it

isn't present.

      import Standard.Examples

example_get = Examples.dictionary.get 2 "zero"