Created
October 9, 2016 18:21
-
-
Save rodamber/1c2b35313453474b805683af5af23454 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
moneys = [50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01] | |
def ex5(quantity): | |
quantities = {m: 0 for m in moneys} | |
for m in moneys: | |
while quantity >= m: | |
quantity -= m | |
quantities[m] += 1 | |
return quantities |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment