medium10 pts · first answer countspythonpython-basics
Inverting a dict with repeated values
What is the result of this comprehension?
d = {"a": 1, "b": 2, "c": 1}
{v: k for k, v in d.items()}Discussion 0
Join free to post in the discussion.
Related questions
- Changing an item in a tupleData Scientist
- Reading a missing dictionary key safelyData Scientist
- List comprehension with a conditionData Scientist
- is versus == for two listsData Scientist
- Slicing part of a stringData Scientist
- Floor division with a negative numberData Scientist
- Checking 0.1 + 0.2 == 0.3Data Scientist
- Formatting a price with an f-stringData Scientist