的非INT繁衍序列我在這裏是初學者,以及在Python編程,和我目前使用的代碼學院幫助我學習。所以我決定冒險離開,自己做一個程序,並繼續陷入錯誤信息:無法乘以類型爲'float'的非int int序列也能收到錯誤消息:無法按類型「浮動」
該程序非常簡單,一個小費計算器要求用戶輸入信息以使程序確定小費金額和賬單總額。直到數學的這一點才確定。我知道這不是「漂亮」,但只是我真的想弄清楚如何使用它。任何幫助將不勝感激!
這是我到目前爲止有:
print ("Restuarant Bill Calculator")
print ("Instructions: Please use only dollar amount with decimal.")
# ask the user to input the total of the bill
original = raw_input ('What was the total of your bill?:')
cost = original
print (cost)
# ask the user to put in how much tip they want to give
tip = input('How much percent of tip in decimal:')
tipamt = tip * cost
print "%.2f" % tipamt
# doing the math
totalamt = cost + tipamt
print (totalamt)
請添加完整的錯誤消息完全錯誤的路線。更一般地說,請閱讀[mcve]和[問]。 (你可能想乘以一個浮動的字符串) –