作业

show_menu=[
(‘鞋子’,300),
(‘电脑’,4000),
(‘手机’,5000),
(‘桌子’,800),
(‘椅子’,200),
]
choice = input("请输入想要买的商品:")
if choice==“鞋子”:
print(“您将”+choice+“加入购物车”)
choice=int([“鞋子”])

elif choice==“电脑”:
print(“您将”+choice+“加入购物车”)
choice=int([“电脑”])

elif choice==“手机”:
print(“您将”+choice+“加入购物车”)
choice=int([“手机”])

elif choice==“桌子”:
print(“您将”+choice+“加入购物车”)
choice=int([“桌子”])

elif choice==“椅子”:
print(“您将”+choice+“加入购物车”)
choice=int([“椅子”])

print(jiezhang)
else: 
print("输入错误")

你可能感兴趣的:(作业)