dict()
Create a dictionary of key-value pairs.
dict(**kwargs)
dict() creates a dictionary. You can pass named values, another mapping, or pairs of keys and values.
Parameters
- kwargs
- Optional named values to use as dictionary keys and values.
Returns
A new dictionary.
Try it
Run it and change it
scores = dict(ada=10, ben=8)
print(scores["ada"]) Output
Press Run to see what it prints.