Question 3: Input Fruit Shop Calculator

🍎 Fruit Shop Calculator

Use: import task_input_03

Maya visits a fruit shop where each apple costs 3 dollars. She wants to buy some apples. Write a Python program that asks Maya how many apples she wants to buy and calculates the total cost.
  • Use input("How many apples? ") to ask the user how many apples they want to buy. Store the answer in a variable called quantity_text.
  • Convert quantity_text to an integer using int() and store the result in a variable called quantity.
  • Store the price of one apple in a variable called price and set it to 3.
  • Calculate the total cost and store it in a variable called total using quantity * price.
  • Print the total cost using:
    Total cost: <total>
Write what you are looking for, and press enter to begin your search!