标签:express ack lin class invalid call name shell back
# 方式1 >>> d = dict(name=‘Bob‘, age=20, score=88) >>> print(d) {‘name‘: ‘Bob‘, ‘age‘: 20, ‘score‘: 88} >>> d = dict("name"=‘Bob‘, "age"=20, "score"=88) SyntaxError: keyword can‘t be an expression >>>d = dict("name":‘Bob‘, "age":20, "score":88) SyntaxError: invalid syntax # 方式2 >>> d = {"name":‘Bob‘, "age":20, "score":88} >>> print(d) {‘name‘: ‘Bob‘, ‘age‘: 20, ‘score‘: 88} >>> d = {"name"=‘Bob‘, "age"=20, "score"=88} SyntaxError: invalid syntax >>> d = {name:‘Bob‘, age:20, score:88} Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> d = {name:‘Bob‘, age:20, score:88} NameError: name ‘name‘ is not defined
标签:express ack lin class invalid call name shell back
原文地址:https://www.cnblogs.com/david-lcw/p/10051275.html