好的,所以我对编程很陌生。我已经开始自学 python-3.2,并且正在尝试编写一个程序来显示任何餐馆账单如果有 15% 的小费和 20% 的小费。我不断得到:
Traceback (most recent call last):
File "/home/marian/restaurantbilltotal.py", line 6, in <module>
print(fifteen ("Plus a 15% tip: "))
TypeError: 'int' object is not callable tip
我写的代码是:
#Restaurant bill total
bill = int(input("Restaurant bill total: "))
fifteen = (bill // 100) * 15 + bill
print(fifteen ("Plus a 15% tip: "))
twenty = (bill // 100) * 20 + bill
print(twenty ("Plus a 20% tip: "))
input("\n\nPress the enter key to exit.")
请帮忙,但请记住,我才刚刚开始学习如何编程:-)。谢谢。