我是一个新手(大概两周),正在尝试学习Python2.7x。我正在尝试做一个基本的程序,有一个用户输入一顿饭的费用,它输出多少钱,它将与.15小费。我希望输出看起来像23.44 (显示2个小数)
我的代码:
MealPrice = float(raw_input("Please type in your bill amount: "))
tip = float(MealPrice * 0.15,)
totalPrice = MealPrice+tip
int(totalPrice)
print "Your tip would be: