week-3 #4

Merged
Kenwood merged 7 commits from week-3 into master 2021-01-24 03:03:01 -05:00
1 changed files with 24 additions and 0 deletions
Showing only changes of commit d27d5025fb - Show all commits

View File

@ -0,0 +1,24 @@
try:
user_cents = int(input('Cents: '))
except ValueError:
print('Cannot cannot parse input.')
exit()
change = []
while user_cents > 100:
user_cents -= 100
change.append('Dollar')
while user_cents > 25:
user_cents -= 25
change.append('Quarter')
while user_cents > 10:
user_cents -= 10
change.append("Dime")
while user_cents > 5:
user_cents -= 5
change.append("Nickel")
for _i in range(user_cents):
change.append("Penny")
print(change)