-
Notifications
You must be signed in to change notification settings - Fork 0
/
Count_money.py
22 lines (19 loc) · 1.02 KB
/
Count_money.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#CHY - 1, 5, 10, 20, 50, 100위안(자오, 및 펀은 폐기처리중)
#EUR - 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2/ 5, 10, 20, 50, 100, 200, 500 유로
#USD - 0.01, 0.05, 0.1, 0.25, 0.5/ 1, 5, 10, 20, 50, 100, 500, 1000, 5000, 10000, 100000달러
#JPY - 1, 5, 10, 50, 100, 500/ 1000, 2000, 5000, 10000 엔
def Count_Money(changed):
Money_list = {'USD ':[10000000, 1000000, 500000, 100000, 50000, 10000, 5000, 2000, 1000, 500, 100, 50, 25, 10, 5, 1],
'EUR ':[50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1],
'CNY ':[10000, 5000, 2000, 1000, 500, 100],
'JPY ':[1000000, 500000, 200000, 100000, 50000, 10000, 5000, 1000, 500, 100]}
cnt = 0
for i in Money_list:
a = changed[cnt]//Money_list[i][-1]*Money_list[i][-1]
res = {}
for j in Money_list[i]:
res[j/100] = str(a // j)+'개'
a = a % j
print(i+str(changed[cnt])+': ',res)
cnt=cnt+1
# Count_Money([123213031, 12303020, 37900, 1230300])