函数第三讲最后解包字典
def mike(x,y,z):print(x,y,z)
bob = {"a":1, "b":2, "c":3}
mike(**bob)
Traceback (most recent call last):
File "<pyshell#50>", line 1, in <module>
mike(**bob)
TypeError: mike() got an unexpected keyword argument 'a'
# 求助大家为什么这里解包字典会报错啊 def mike(x,y,z):
print(x,y,z)
bob = {"x":1, "y":2, "z":3} # 这个字典的键得跟函数的参数名一样
mike(**bob)
页:
[1]