Write a decision making program.
Please do help
Attachments:
Answers
Answered by
1
def discount(amount):
keys = ["Discount", "Final Amount", "Gift"]
if amount <= 2000:
discount, gift = amount * .05, "Wallet"
final = amount - discount
return dict(zip(keys, [discount, final, gift]))
if 2000 < amount <= 5000:
discount, gift = amount * .08, "Clock"
final = amount - discount
return dict(zip(keys, [discount, final, gift]))
if 5000 < amount <= 10000:
discount, gift = amount * .1, "Bag"
final = amount - discount
return dict(zip(keys, [discount, final, gift]))
discount, gift = amount * .15, "Watch"
final = amount - discount
return dict(zip(keys, [discount, final, gift]))
for k, v in discount((amount := float(input("enter amount: ")))).items():
print(f"{k}: {v}")
Similar questions