1.创建空字典>>> dic = {} >>> type(dic) <type 'dict'>2.直接赋值创建>>> dic = {'spam':1, 'egg':2, 'bar':3} >>> dic {'bar': 3, 'egg': 2, 'spam': 1}3.通过关键字dict和关键字参数创建>>> dic = dict(spam = 1, egg = 2, bar =3) >>> dic {'bar': 3, 'egg': 2, 'spam': 1}4