-
-
Save AnisahTiaraPratiwi/9d0e5b766bd9d8d65f8632ac956bcc6e to your computer and use it in GitHub Desktop.
bill = 47.28 | |
tip = 0.15 * bill | |
total = bill + tip | |
share = total/2 | |
print("Each person needs to pay: " + str (share)) |
really worked thankyoy
Thnx!
bill = 47.28
tip = ((bill * 15)/100)
total = bill + tip
share = total/2
print("Each person needs to pay:" + str(share))
bill = 47.28
tip = (bill * 15)/100
total = bill + tip
share = total/2
print("Each person needs to pay:" + str(share))
bill = 47.28
tip = bill * 0.15
total = bill + tip
share = total / 2
print(f"Each person needs to pay: {share}")
bill = 47.28
tip = 0.15 * bill
total = bill + tip
share = total/2
print("Each person needs to pay: " + str (share))
Fair Share Settlement
You and K of your friends gather for dinner at a restaurant, and the total bill is Rs. V. You pay the entire bill, and since everyone shared the food equally, the bill needs to be split evenly among you all.
After asking your friends to reimburse their fair shares, each person pays you back. However, if the amount to be paid back wasn't an integer, they round down to the previous integer value. For example, if each friend should have paid Rs. 13.2, they instead pay Rs. 13. Even if they should have paid Rs. 13.79, they still only pay Rs. 13, rounding down.
Calculate the net amount that you ended up paying after everyone settles their debts.
Great work!