25 lines
486 B
Python
25 lines
486 B
Python
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)
|