From 7fce1ebb4eb9b3a2486bca15dd61c5b510e339d7 Mon Sep 17 00:00:00 2001 From: Waris Hayat Date: Wed, 29 Nov 2023 15:41:28 +0000 Subject: [PATCH] Conditional statment example4 --- Conditionalstatment4.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Conditionalstatment4.py diff --git a/Conditionalstatment4.py b/Conditionalstatment4.py new file mode 100644 index 0000000..1180c1f --- /dev/null +++ b/Conditionalstatment4.py @@ -0,0 +1,15 @@ +#QUESTION: if cost and selling price of the item enter through the keyboard.write a program\nto determinewether the seller has made profit or loss or no profit no loss.Also determine how much profit or loss he incurred? +#its the part of the if else loop. + + +cost_price=int(input('Enter the cost price of the item:- ')) +sell_price=int(input('Enter the sell price of the item:- ')) + +if cost_price>sell_price: #if cost price is higher the selling + loss=cost_price-sell_price + print('You sell the item in low price you made the loss of rs=',loss) +if sell_price>cost_price: #if sell price is higher the Cost + profit=sell_price-cost_price + print('Congrats You sell the item with profit rs=',profit) +else: #if sell price is equal the Cost price + print("You make no profit no loss :-) ") \ No newline at end of file