Write a Python program which : will ask the user to enter total bill amount. If the entered value is more than 2000, it will give 15% discount on it. If it is between 1000 to 2000, it will give 10% discount. If it is below 1000, then no discount will be given. Bill amount generated after discount must be displayed.
Answers
Answered by
0
Answer:
bill = int(input("Enter the total amount:\n"))
discount = False
def discount_more_than2000(integer):
integer=integer-integer*15/100
return integer
def discount_more_than1000(integer):
integer=integer-integer*10/100
return integer
if bill>1000:
discount = True
if bill>2000:
bill = discount_more_than2000(bill)
elif bill>1000:
bill = discount_more_than1000(bill)
else:
discount = False
if discount == False:
print(f"Sorry, you did not get any discount and your total bill is just {bill}.")
else:
print(f"Congratulations! You received a discount! Your bill is now {bill}!")
Explanation:
Similar questions