python_dictionaries
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python_dictionaries [2023/03/01 21:34] – [Convert a dictionary to a string] raju | python_dictionaries [2023/08/02 19:41] (current) – [find key corresponding to a value] raju | ||
---|---|---|---|
Line 6: | Line 6: | ||
* [[Convert a string to a dictionary]] | * [[Convert a string to a dictionary]] | ||
+ | |||
+ | ==== find key corresponding to a value ==== | ||
+ | The following will find the first key corresponding to a given value | ||
+ | < | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | 1 | ||
+ | </ | ||
+ | < | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | >>> | ||
+ | 2 | ||
+ | </ | ||
+ | |||
+ | Sample use case: | ||
+ | * In https:// | ||
==== initialize a dictionary ==== | ==== initialize a dictionary ==== |
python_dictionaries.1677706482.txt.gz · Last modified: 2023/03/01 21:34 by raju