Dictionaries · Lookup By Value · Practice Question
Extract the last key by value
Question
Given the dictionary:
dict:`a`b`c`d`e!9 2 9 2 1Extract the last key whose value is 9.
Solution
last where dict = 9Result:
`cExplanation
where dict = 9 returns `a`c — the keys whose value is 9 — and last picks `c. Find (?) isn't suitable here since it only ever returns the first matching key.