Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decimal(number, places):
- return ('{:0.' + str(places) + 'f}').format(round(number, places))
- def refund_calc(totes, bottles, beercrates, beerbottles):
- refund = (4 * totes) + (0.25 * bottles) + (3.90 * beercrates) + (0.10 * beerbottles)
- #return '{:0.2f}'.format(round(refund, 2))
- return decimal(refund, 2)
- Customer_1 = [3, 8, 0, 0]
- print(refund_calc(*Customer_1))
- Customer_2 = [3, 8, 1, 0]
- print('total refund for customer 2 will be', refund_calc(*Customer_2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement