Python program to calculate discount based on selling price

21-Oct-2022

.

Admin

Python program to calculate discount based on selling price

Hi Dev,

Now, let's see example of Python program to calculate discount based on selling price. We will use Write a Python program to calculate the bill amount to be paid. We will look at example of Python program to calculate discount. if you have question about Solved Write a program to calculate the bill amount then I will give simple example with solution. you will do the following things for Python Tutorial Discount Price Calculator.

Write a python program to calculate the final bill amount to be paid by a customer

let's see below simple example with output:

Example 1: Write a python program to calculate the final bill amount to be paid by a customer


# input net amount

amt = int(input("Enter Amount: "))

# calculate amount with discount

if(amt>0):

if amt<=5000:

disc = amt*0.10

elif amt<=15000:

disc=amt*0.15

elif amt<=25000:

disc=0.20 * amt

else:

disc=0.5 * amt

print("Discount Amount : ",disc)

print("To be paid by Customer : ",amt-disc)

else:

print("Invalid Amount")

Output:

Enter Amount: 10000

Discount Amount : 1500.0

To be paid by Customer : 8500.0

I hope it can help you...

#Python