【发布时间】:2026-02-13 00:00:02
【问题描述】:
def orders(**sandwich):
sand={}
for category,toppings in sandwich.items():
sand[category]=toppings
return sand
orders('cheese'='extra','toppings'='mushroom')
print(orders)
这是我为一个小型项目编写的代码,但我得到了这个错误 语法错误:关键字不能是表达式 请纠正它,我是新手,所以请解释一下 谢谢!
【问题讨论】:
标签: python-3.x function dictionary