1.根据报错来理解,"five"=5属于表达式,而five=5不属于表达式,属于关键字传参,为什么呢?
2.关键字传参应该怎么样理解呢?
dic1 = dict(five=5, six=6) # 传关键字
print(dic1)
print(type(dic1))
#返回:
# {'five': 5, 'six': 6}
#<class 'dict'>
dic2 = dict("five"=5,"six"=6) # 传关键字
print(dic2)
print(type(dic2))
#返回:SyntaxError: keyword can't be an expression