Answer to Question #298752 in Python for reyad

Question #298752

Fiona has recently started acrylic painting and she is planning to order a few canvases and paints from an online stationery shop. The price of each 10 x 10 sized canvas is 120 tk and the price of each 25 ml paint tube is 75 tk. Depending on the total amount ordered from the shop, she will get some discounts. The table below shows the discount she will get on her total amount.


Total Amount (TK) Discount (TK)

0 - 299 No Discount

300 - 499 10

500 - 749 20

750 - 999 50

>= 1000 150

Write a python program and take two inputs from the user. The first input will be the number of canvases and the second input will be the number of paint tubes ordered. Based on the price of each item, calculate the total amount that Fiona needs to pay including the discount.


1
Expert's answer
2022-02-16T16:33:18-0500
def discont(total):
    if total > 0:
        if total < 300:
            return total
        elif total < 500:
            return total - 10
        elif total < 750:
            return total - 20
        elif total < 1000:
            return total - 50
        else:
            return total - 150
    else:
        return "You entered a negative value"

canvas = 120
paintTube = 75

print('Enter number of canvas')
canvasCount = int(input())
print('Enter number of paint tube')
paintTubeCount = int(input())

total = canvasCount * canvas + paintTubeCount * paintTube

print('discount price', discont(total))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS