Created
December 7, 2021 18:33
-
-
Save nietzscheson/5c5a0dbfcab60dd203db7cb8e20e5f96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
import logging | |
logger = logging.getLogger(__name__) | |
def quote(subtotal, vat, payment_quantity): | |
### | |
logger.INFO("Create a Quote") | |
total = subtotal + (subtotal * vat) | |
### | |
logger.INFO(f"The total is: {total}") | |
values = [round(total/payment_quantity,2)] * payment_quantity | |
# values_total = reduce(lambda a=0, e=0: a+e, values) | |
values_total = sum(values) | |
rest = values_total - total | |
values[-1] = round(values[-1] - rest,2) | |
### | |
logger.INFO(f"The values are: {values}") | |
return values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment