guys plzzz help
do not spam
Attachments:
Answers
Answered by
3
def commission(sales):
keys = ["commission rate", "commission"]
if 0 <= sales <= 20000:
rate = .03
commission = sales * rate
return dict(zip(keys, [f"{rate:.2%}", commission]))
if 20000 <= sales <= 50000:
rate = .12
commission = sales * rate
return dict(zip(keys, [f"{rate:.2%}", commission]))
rate = .31
commission = sales * rate
return dict(zip(keys, [f"{rate:.2%}", commission]))
for k, v in commission((sales := float(input("sales: ")))).items():
print(f"{k}: {v}")
Similar questions