Build a Bill Splitter - Step 4

Tell us what’s happening:

Hello,

I don’t have an actual error, the terminal shows that the ammounts are being added correctly, but the program doesn’t let me go to the next task because apparantly, something is not exactly like it wants it to be. I read similar topics and know you’re not told to add a str value, but if you don’t you get a syntax error because running_total is a float.
Please point out what is wrong?

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: ", str(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/145.0.0.0 Safari/537.36

Challenge Information:

Build a Bill Splitter - Step 4

Welcome to the forum @scentedcandle !

Have you tested it without applying str()?

Trying to concatenate running_total to a string would generate a TypeError because you can’t concatenate a string to a number, but you are not concatenating here. You are simply passing running_total as a second argument to console.log().

Happy coding!

Thanks for the response, actually I did try that but the result is the same. I do not get a syntax error, I actually get the som, but it keeps repeating the instructions that I now literally followed.
print("Total bill so far: ", running_total)

Message I get is:

You should print the string Total bill so far: followed by a space and the value of running_total.

Please look carefully at the string in the instructions. Is there a space after the colon?

Wellllll there we go. But in that case, you should update the instructions the program gives, because it explicitely tells you to add “Total bill so far:” followed by a space.

Agree. And I thought this GitHub issue would handle that, but although it’s mentioned in the comments, the print instructions were not clarified.

If you would like to create another issue for this specifically, please refer to the following:


Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.