Build a Bill Splitter - Step 4

Tell us what’s happening:

I can not find the mistakes in my code. Please help me !

Your code so far

running_total = 0

num_of_friends = 4

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


# User Editable Region

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

# 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/146.0.0.0 Safari/537.36

Challenge Information:

Build a Bill Splitter - Step 4

Welcome to the forum @Kams !

You are asked to print the value of the running_total variable, not the string ‘running_total’.

You can either print an f-string or pass in two arguments (a string and a variable).

Happy coding!

1 Like

This is my code:

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(f’Total bill so far: {str(running_total)}')

I am getting error: “You should print the string Total bill so far: followed by a space and the value of running_total.”

Can anyone help?

Please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Help button image located on each challenge. This will automatically import your code in a readable format and pull in the challenge URL while still allowing you to ask any question about the challenge or your code.

Thank you.


Perfect! My code works!

I apologize. I did not mean to make this a comment. Thanks for instructing me!