1 | def calculate_discount(amount): |
2 | if(amount > 0): |
3 | if amount <= 15: |
4 | disc = amount * 0.05 |
5 | elif amount <= 50: |
6 | disc = 0.2 * amount |
7 | else: |
8 | disc = 0.4 * amount |
9 | return disc |
10 | |
11 | def main(): |
12 | price = int(input("Enter the original price: ")) |
13 | discount = calculate_discount(price) |
14 | print("Discount:", discount) |
15 | print("The new price:", price - discount) |
16 | |
17 | main() |
18 |