Build a Bill Splitter - Step 4

Tell us what’s happening:

dont know, i tried different ways, gpt didnt help( plz help me

Your code so far


# User Editable Region

running_total = 0

num_of_friends = 4

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

running_total += appetizers
running_total += main_courses
running_total += desserts
running_total += drinks


print("Total bill so far: " + str(running_total))

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0

Challenge Information:

Build a Bill Splitter - Step 4

please update the value of running_total summing everything and using only =, not +=

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: " + str(running_total))

same:

// running tests
2. You should print the string Total bill so far: followed by a space and the value of running_total.
// tests completed
// console output
Total bill so far: 198.82999999999998

write print with two arguments, one being the string, the other running_total

1 Like

Try using a f-string to print.

1 Like

ohhh, en not my main lang))

put a comma between the string and the variable

1 Like

not obvious, thank u!

Can you show me what the last line of your of your code is please as I am still getting an error. At the moment I have this:

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: ’ + str(running_total))

So print(“Total bill so far: “ , str(running_total)) as I am still getting an error :frowning:

This also gets an error but the output is correct print(“Total bill so far: “ + str(running_total)) as I am still getting an error :frowning:

hi @cheulie , can you please create your own topic?

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

there is a space in your code in the last string between : and “, delete that space and try again