/ Published in: Python
Any keyword arguments you pass to the dict constructor are added to the newly created dictionary before returning. Of course, you are limited to the keys that can be made into keyword arguments: valid Python variable names.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
dict(a=1, b=2, c=3) returns {'a': 1, 'b': 2, 'c': 3}