Question 15: Operators

Minecraft Tool Shopping

Steve is gathering tools for his next Minecraft adventure. He bought a diamond pickaxe for $80, a shield for $30, and torches for $15. Write a Python program to calculate the total money Steve spent.

  1. Store Steve’s name in a variable called name.
  2. Define variables for the costs of the pickaxe, shield, and torches:
    • Store the cost of the pickaxe in a variable called pickaxe_cost and set it to 80.
    • Store the cost of the shield in a variable called shield_cost and set it to 30.
    • Store the cost of torches in a variable called torch_cost and set it to 15.
  3. Calculate the total amount by adding pickaxe_cost, shield_cost, and torch_cost.

Print Output:
“Hi Steve! You spent a total of $[total_spent] on your Minecraft tools.”

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