的非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]和[问]。 (你可能想乘以一个浮动的字符串) –