can any one solve this...? in python <br />WAP to enter total bill amount and calculate discount as per given table and also calculate net payable amount (total=bill-discount) in python..
Attachments:
Answers
Answered by
4
def calc_discount(bill_amount):
if bill_amount >= 20000:
return bill_amount * (1 - .15)
if bill_amount >= 15000:
return bill_amount * (1 - .1)
if bill_amount >= 10000:
return bill_amount * (1 - .05)
return bill_amount
if __name__ == "__main__":
bill_amount = float(input("bill amount: "))
print(f"net payable amount: {calc_discount(bill_amount)}")
Similar questions