While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. If quantity and price per item are input through the keyboard, write a Python program to calculate the total expenses.

print("Enter Quantity: ")
qty = float(input())

print("Enter Rate: ")
rate = float(input())

if (qty>1000) :
	dis = 10
expense = (qty*rate) - (qty*rate*dis / 100)
print("\nTotal Expenses = Rs. ", expense)

Output :
Enter Quantity and Rate: 1020
120

Total Expenses = Rs. 110160.000000



Leave a comment