Question: I wrote this code: def giveChange(amt): quarter = 0 nickels = 0 dimes = 0 pennies = 0 quarters = int(amt / 25) amt =
I wrote this code:
def giveChange(amt): quarter = 0 nickels = 0 dimes = 0 pennies = 0 quarters = int(amt / 25) amt = amt % 25 dimes = int(amt / 10) amt= amt % 10 nickels = int(amt / 5) amt = amt %5 pennies= amt return quarters, nickels, dimes, pennies
amt = int(input("Enter the number between 0 and 99: ")) quarters, nickels, dimes, pennies = giveChange(amt) print('Q: {}, N: {}, D: {}, P: {}'.format(quarters, nickels, dimes, pennies))
I was wondering if there is another way to write it so that I can comment out the test case with #
How would change this so I can comment out the test case?
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
