一、字典 dict 類型的初始化賦值python
refer to:https://stackoverflow.com/questions/8406242/why-does-pycharms-inspector-complain-about-dapp
my_dict = {} my_dict['key1'] = 'value1' my_dict['key2'] = 2
dict 初始化應儘可能寫在一個語句裏。list 也如此,只要是明確包含的元素,都應當在初始化階段寫在變量定義裏面。spa
my_dict = {'key1': 'value1' 'key2': 2}