Creating a new dictionary in Python

后端 未结 7 2028
难免孤独
难免孤独 2020-11-29 15:17

I want to build a dictionary in Python. However, all the examples that I see are instantiating a dictionary from a list, etc . ..

How do I create a new empty diction

7条回答
  •  难免孤独
    2020-11-29 15:46

    >>> dict(a=2,b=4)
    {'a': 2, 'b': 4}
    

    Will add the value in the python dictionary.

提交回复
热议问题