2. Write a Python program to find the sale price of an item with a given cost and discount (%).

Solution :-

Static :-

cost = 10000
disc = 50

disc_amt = cost * disc/100
sale_price = cost-disc_amt

print(“The cost price of an Item”,cost)
print(“Discount (%) given”,disc)
print(“Sale price is :- “, sale_price)

 
Output :- 

Dynamic :- 

cost = float(input(“Enter the cost of an Item :- “))
disc = int(input(“Enter the Discount (%) to be given :- “))

disc_amt = cost * disc/100
sale_price = cost-disc_amt

print(“The cost price of an Item”,cost)
print(“Discount (%) given”,disc)
print(“Sale price is :- “, sale_price)

 
Output :-