Write a program in python to input the selling price and cost pr
ice from the user and find the profit and loss of the product
Answers
Write a program in python to input the selling price and cost pr ice from the user and find the profit and loss of the product
Explanation:
Python Program to Calculate Profit or Loss
CP = float(input(" Please Enter the Cost Price of the product: "))
SP = float(input(" Please Enter the Sale Price of the product: "))
if(CP > SP):
amount = CP - SP
print("Total Loss Amount = {0}".format(amount))
elif(SP > CP):
amount = SP - CP
print("Total Profit = {0}".format(amount))
else:
print("There is no Profit no Loss....")
OUTPUT
Please Enter the Cost Price of the product: 6000
Please Enter the Sale Price of the product: 4700
Total Loss Amount = 1300.0
Answer:
#Pg 178 Q 15 Sumit Arora
#Please note - CP = Cost Price & SP = Selling Price
CP= float(input("Please Enter the Cost Price of the product Rs : "))
SP = float(input("Please Enter the Sale Price of the product Rs : "))
if(CP > SP):
amount = CP - SP
print("Total Loss=Rs",(amount))
elif(SP > CP):
amount = SP - CP
print("Total Profit=Rs",(amount))
else:
print("There is no Profit nor Loss")
Explanation: