Question 9: Operators

Sarah is running a lemonade stand. She bought lemons for $8, sugar for $5, and cups for $3. She sold each cup of lemonade for $2. Write a Python program to calculate how much profit Sarah made from selling lemonade.

  • Start by asking for Sarah’s name and store it in a variable called name.
  • Define variables for the costs:
    • Store the cost of lemons in a variable called lemon_cost and set it to 8.
    • Store the cost of sugar in a variable called sugar_cost and set it to 5.
    • Store the cost of cups in a variable called cup_cost and set it to 3.
    • Store the selling price per cup of lemonade in a variable called selling_price and set it to 2.
  • Calculate the total cost of ingredients by adding the cost of lemons, sugar, and cups.
  • Calculate the total revenue by multiplying the selling price per cup by the number of cups sold (assuming she got 10 cups for $3 in total).
  • Calculate the profit by subtracting the total cost from the total revenue.
  • Print a message that includes Sarah’s name and the profit she made in a friendly sentence.
Write what you are looking for, and press enter to begin your search!