logo CodeStepByStep logo

count_quarters

Language/Type: Python parameters return

Write a function named count_quarters that accepts an integer representing a number of cents as a parameter and returns the number of quarter coins represented by that many cents. Don't count any whole dollars, because those would be dispensed as dollar bills. For example, count_quarters(64) would return 2, because 64 cents is equivalent to 2 quarters with 14 cents left over. A call of count_quarters(1278) would return 3, because after the 12 dollars are taken out, 3 quarters remain in the 78 cents that are left.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.