Question 17: Operators

Profit or Loss Calculation for Electronics Store

James owns an electronics store and decided to purchase 1500 smartphones at a price of $400 each. He then sold each smartphone for $500. Write a Python program to calculate whether James made a profit or a loss.

  • Start by typing James’s name and store it in a variable called name.
  • Define variables for:
    • The number of smartphones purchased (phones), set to 1500.
    • The cost price of each smartphone (cost_price), set to $400.
    • The selling price of each smartphone (selling_price), set to $500.
    •  
  • Calculate:
    • The total cost by multiplying the number of smartphones purchased by the cost price.
    • The total revenue by multiplying the number of smartphones purchased by the selling price.
    • The profit or loss by subtracting the total cost from the total revenue.
  • Print a message showing how much James made as profit.
Write what you are looking for, and press enter to begin your search!