要求總價,稅款和小費。然後相互加入並給出總價。
from time import sleep
def getprice():
return input("What's the price of your bill?").lower()
price = getprice()
def gettax():
return input("What's the restaurant's tax percent?").lower()
tax = gettax()
def gettip():
return input("How much tip do you want to leave?")
tip = gettip()
percentage = float(tax)/100
total= price*percentage + price + tip
print(total)
它給我和錯誤的總=行,我看了很多文章,但我無法修復它可以幫助我嗎?TypeError:無法乘以類型'float'錯誤的非整數序列我已經試過了一切
你,你需要Corrs的變量轉換爲整數或浮點數。 –