Question 19: Operators

Emma is planning a wedding reception. She spent $500 on venue rental, $300 on catering, $150 on decorations, $200 on photography, and $100 on music.

Write a Python program to calculate the total money Emma spent on all the items.

  1. Start by asking for Emma’s name and store it in a variable called name.
  2. Define variables for the costs of the venue rental, catering, decorations, photography, and music:
    • Store the cost of venue rental in a variable called venue_cost and set it to 500.
    • Store the cost of catering in a variable called catering_cost and set it to 300.
    • Store the cost of decorations in a variable called decorations_cost and set it to 150.
    • Store the cost of photography in a variable called photography_cost and set it to 200.
    • Store the cost of music in a variable called music_cost and set it to 100.
  3. Calculate the total amount spent by adding all the item costs.
  4. Store the total amount in a variable called total_cost.
  5. Print a message that includes Emma’s name and the total amount spent in a friendly sentence, like this:
    “Hi [name]! You spent a total of $[total_cost] on your wedding reception preparations.”
 
 
 
Write what you are looking for, and press enter to begin your search!