Build a Bill Splitter - Step 8

Tell us what’s happening:

Ok, I’m using a Win 11 pro with Mozilla Firefox ver. 152.0.4. Step 8 in Build a Bill Splitter asks to use the round() function to round a number to 2 decimal places. I add the function, and I believe that my formatting is correct, yet the code does not compile. It returns a hint to add the round() function, which I have done. Could someone please check my code to see what I am doing wrong. Thanks

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

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



# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.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

when you do this, nothing happens because the value returned by round is lost in the void

you are not doing this:

Use the round() function to round final_bill to two decimal places and assign the result to a new variable named each_pays.

Hi @Wayne49,

Python’s round() function does not round in place. You must assign it to a variable.

Happy coding