Build a Bill Splitter - Step 8

Tell us what’s happening:

You should use the round() function to round final_bill to two decimal places and assign the result to your each_pays variable.

I am baffled how to arranged the assignments here.. but I got the right output, right?

Your code so far

running_total = 0

num_of_friends = 4

appetizers = 37.89
main_courses = 57.34
desserts = 39.39
drinks = 64.21

running_total += appetizers + main_courses + desserts + drinks
print('Total bill so far:', running_total)

tip = running_total * 0.25
print('Tip amount:', tip)

running_total += tip
print('Total with tip:', running_total)

final_bill = running_total / num_of_friends
print('Bill per person:', final_bill)
# User Editable Region

each_pays = round(final_bill)
round(final_bill, 4)
print('Each person pays:', each_pays)
# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0

Challenge Information:

Build a Bill Splitter - Step 8

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-bill-splitter/697a7f71ebfcd9e4cacd69c2.md at main · freeCodeCamp/freeCodeCamp · GitHub

the first line is missing the second argument to round to two decimal places

the second line is rounding to 4 decimal places, but is also not saving the value anywhere

Howwww? i don’t really understand what you mean, i have tried changing it, but i coudn’t get this step.

you need to do two things here, you need to round final_bill to two decimal places

and you need to assign the rounded value to each_pays

which of these two thigns do you think you are having issues with?

rounding final_bill to two decimal places?

what is your best guess on how to do that?

ohmy, I got it! i change it to 2!

good job!