Last active
October 17, 2020 07:33
-
-
Save Saarth-Jain/57f8dbe6279afb05dbf97acb28d65a82 to your computer and use it in GitHub Desktop.
CS50 solution pset6 cash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cs50 import get_float | |
co = 0 | |
coin_count = 0 | |
while (co <= 0): | |
co = get_float("Change owed: ") | |
co = co * 100 | |
while co >= 25: | |
co -= 25 | |
coin_count += 1 | |
while co >= 10: | |
co -= 10 | |
coin_count += 1 | |
while co >= 5: | |
co -= 5 | |
coin_count += 1 | |
while co >= 1: | |
co -= 1 | |
coin_count += 1 | |
print(f"{coin_count}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment