16/28
Part 5 of 7 · What it costsLearn and do
Some amounts can't be made
Every amount so far could be made from the coins. Change the coins, and some amounts can't.
With coins of 2 and 5, nothing makes 1 or 3 cents
amounts = range(11)
print("cents ", *[f"{t:>3}" for t in amounts])
print("fewest", *[f"{min_coins(t / 100, [0.02, 0.05]):>3}" for t in amounts])
print("ways ", *[f"{count_ways(t / 100, [0.02, 0.05]):>3}" for t in amounts])
Coins of 2 and 5 cents. Which amounts from 0 to 10 can't be made?
Pick one to see what it prints.
Pick an answer above to see the rest
Coins of 10 and 25. Their GCD, the largest number that divides both, is 5. Can any mix make 32 cents?
Pick an answer above to see the rest
What does reduce(math.gcd, [12, 18, 8]) give?
Pick one to see what it prints.
Pick an answer above to see the rest