Compare commits
No commits in common. "ab881dd5789eff801399dca511ab93a8a42cf435" and "f5ef14dee8f0af89d4afc3af7d21f8c731ac9a62" have entirely different histories.
ab881dd578
...
f5ef14dee8
|
@ -1,7 +1,7 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
input_month = input('Input a month to analyse: ')
|
input_month = input('Input a month to analyse: ')
|
||||||
input_day = int(input('Input a day of that month: '))
|
input_day = int(input('Input a day of that month: '))
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
try:
|
|
||||||
user_cents = int(input('Cents: '))
|
|
||||||
except ValueError:
|
|
||||||
print('Cannot cannot parse input.')
|
|
||||||
exit()
|
|
||||||
|
|
||||||
change = []
|
|
||||||
coins = [
|
|
||||||
['Dollars', 'Dollar'],
|
|
||||||
['Quarters', 'Quarter'],
|
|
||||||
['Dimes', 'Dime'],
|
|
||||||
['Nickels', 'Nickel'],
|
|
||||||
['Pennies', 'Penny']]
|
|
||||||
|
|
||||||
while user_cents >= 100:
|
|
||||||
user_cents -= 100
|
|
||||||
change.append(coins[0])
|
|
||||||
while user_cents >= 25:
|
|
||||||
user_cents -= 25
|
|
||||||
change.append(coins[1])
|
|
||||||
while user_cents >= 10:
|
|
||||||
user_cents -= 10
|
|
||||||
change.append(coins[2])
|
|
||||||
while user_cents >= 5:
|
|
||||||
user_cents -= 5
|
|
||||||
change.append(coins[3])
|
|
||||||
for _i in range(user_cents):
|
|
||||||
change.append(coins[4])
|
|
||||||
|
|
||||||
if len(change) != 0:
|
|
||||||
for coin in coins:
|
|
||||||
num_coins = change.count(coin)
|
|
||||||
if num_coins != 0:
|
|
||||||
if num_coins > 1:
|
|
||||||
print('{0} {1}'.format(num_coins, coin[0]))
|
|
||||||
else:
|
|
||||||
print('{0} {1}'.format(num_coins, coin[1]))
|
|
||||||
else:
|
|
||||||
print('No change ')
|
|
||||||
|
|
Loading…
Reference in New Issue