I don’t understand what it means by ‘You should update running_total using the += operator once to add all four course costs.’ It is saying this when I submit my code.
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 += 37.89 + 57.34 + 39.39 + 64.21
print('Total bill so far:')
print(running_total)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Use the += operator once to add appetizers, main_courses, desserts, and drinks to running_total.
We already stored each cost in a variable with a meaningful name. So instead of repeating the raw numbers, we should reference those variables. You can think of variables like labeled boxes, such as, appetizers is a the box holding 37.89. Why write 37.89 again when you can just say appetizers?
That’s why you define those variables upfront—to use them in the calculation. Makes it way easier if a price changes and you only have to update one spot.