我只是个python新手,有人能帮我写代码吗?我为这个问题困了一个星期
下面是我代码:
price = {
"Espresso": 5.80,
"Americano": 6.90,
}
currency = "$"
print ("welcome coffee machine!\t")
name = input ("can i get your name?\n")
print ("what do you like to order mr/ms " + name + "\n" )
menu = ("Espresso, Americano")
print (menu)
menu = (input())
quantity = input("How many " + menu + " would you like?\n")
quantity = str(input())
#im stuck at here! T_T
if menu == "Espresso" :
price = 5.80
total = quantity * price
quantity.append(quantity)
price.append(price)
print(total)
elif menu == "Americano":
price = 6.90
total = quantity * price
quantity.append(quantity)
price.append(price)
print(total)
else:
menu()
#invoice receipt
print("Thank you for order " + name + ", please wait your " + menu + " at counter\n")
希望某人/某人能帮我解决这个问题
1条答案
按热度按时间k97glaaz1#
由于此行,您将收到错误:
你要用
string
乘以float
。