为什么我的答案没有使用 python 中的 Round 函数四舍五入到小数点后两位?

Why is my answer not rounding to two decimal points using the Round function in python?

#下面是我的代码。它不会接受回合的代码有什么问题?我搜索了 stack overflow,根据搜索结果,它似乎是正确的,但有些地方不对劲。我得到了正确的答案,但我的答案显示不正确,假设账单是 150,应该是 33.60,小费是 12,5 个人分摊账单。

print("Welcome to the tip calculator!")
Bill_A = float(input("What was the total bill?"))
Tip_A = float(input("How much tip would you like to give? 10, 12, or 15?"))
Bill_Split = float(input("How many people to split the bill?"))
 
#Convert Tip to decimal for calculation.
Tip_B = (Tip_A / 100) + 1.00
 
Total_Bill = ((Bill_A / Bill_Split) * Tip_B)
 
Total_Bill2 = round(Total_Bill, 2)
 
print(f"Each person should pay: ${Total_Bill2}" )

我猜你想显示 33.60。如果是这样,请使用此代码。我已经使用 %.2f 设置了两位小数

print("Welcome to the tip calculator!")
Bill_A = float(input("What was the total bill?"))
Tip_A = float(input("How much tip would you like to give? 10, 12, or 15?"))
Bill_Split = float(input("How many people to split the bill?"))
 
#Convert Tip to decimal for calculation.
Tip_B = (Tip_A / 100) + 1.00
 
Total_Bill = ((Bill_A / Bill_Split) * Tip_B)
 
print(f"Each person should pay: %.2f" % Total_Bill )