Question 16: Operators

Vacation Shopping

Alex is preparing for his upcoming vacation. He bought a plane ticket for $250, a suitcase for $60, and sunscreen for $20. Write a Python program to calculate the total money Alex spent.

Store Alex’s name in a variable called name.
Define variables for the costs of the plane ticket, suitcase, and sunscreen:

  • Store the cost of the plane ticket in a variable called ticket_cost and set it to 250.
  • Store the cost of the suitcase in a variable called suitcase_cost and set it to 60.
  • Store the cost of the sunscreen in a variable called sunscreen_cost and set it to 20.

Calculate the total amount by adding ticket_cost, suitcase_cost, and sunscreen_cost.

Print Output:
“Hi Alex! You spent a total of $[total_spent] on your vacation shopping.”

Write what you are looking for, and press enter to begin your search!