Question: How do I solve this problem using simple mathematical operators on python? Console output will be displayed here 1 amount = 67 2 3 #You
How do I solve this problem using simple mathematical operators on python?

Console output will be displayed here 1 amount = 67 2 3 #You may modify the lines of code above, but don't move them! 4 #When you Submit your code, we'll change these lines to 5 #assign different values to the variables. 7 #Write a program that will print out the coins needed to 8 #arrive at the amount shown above. Assume that we always want 9 #the maximum number of large coins: for example, for 67 cents, 10 #we want 2 quarters, 1 dime, 1 nickel, and 2 pennies instead 11 #of 6 dimes and 7 pennies. 13 #If you are unfamiliar with American currency: a quarter is 14 #worth 25 cents; a dime is worth 10 cents; a nickel is worth 15 #5 cents; a penny is worth 1 cent. 16 17 #To make things easier, we've gone ahead and supplied your 18 #print statements. All you need to do is create four variables: 19 #quarters, dimes, nickels, and pennies. 20 21 =HINT: Change the value of amount as you go to reflect what 22 #coins you've already found. 23 24 25 #Add your code here! 26 quarters = 2 27 dimes = 1 28 nickels = 1 29 pennies = 2 30 If your code above is correct, the following lines will 31 #initially print (for amount = 67): 32 Quarters: 2 33 Dies: 1 34 dickes: 1 35 Pencies: 2 36 print("Quarters:", quarters) 37 print("Dimes:", dimes) 38 print("Nickels:", nickels) 39 print("Pennies:", pennies)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
