Question: Define a function consolidate _ change that takes as arguments counts of different US coins ( similar to the previous function ) and prints out
Define a function consolidatechange that takes as arguments counts of different US coins similar to the previous function and prints
out the simplest number of bills and coins needed to make that amount. pt
For example, when called with arguments of quarters, dimes, nickels, and pennies, the function should print:
Number of dollars:
Number of quarters:
Number of dimes:
Number of nickels:
Number of pennies:
Total amount: $
You must use your previous valueofchange method in this calculation to determine the total amount.
Hint: think about converting the coins to a giant pile of pennies, and then determining how many whole number dollars you can divide
them into. Then put those pennies aside, and determine how many whole number quarters you can make with the rest, etc.
Call your consolidatechange function to test it passing in some number of coins for it to consolidate the values you pass are your
choice!
Part Time
Note: this is the hardest part of the assignment! Plan accordingly.
Import the date value from the datetime module. pt
Use the date function from the datetime module to create a variable endofquarter that represents the last day of the current
quarter check the UW Calendar Note that this function will return a value of type date not a string or a numberpt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
