Briefly talk about several ways to create a dictionary

Briefly talk about several ways to create a dictionary

Write directly in the form of key-value pairs

Use commas to separate key-value pairs

dict0 = {
    
    'name': 'xxx', 'age': 23}

Use dict function

dict1 = dict()

Guess you like

Origin blog.csdn.net/weixin_48445640/article/details/108810377