Skip to content

Commit

Permalink
Create 2-7_Change.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jisunp04023 authored Oct 21, 2023
1 parent f363b11 commit d4b0a0e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 2-7_Change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
def solution(money):
coin = [10, 50, 100, 500, 1000, 5000, 10000, 50000]
counter = 0
idx = len(coin) - 1
while money:
counter += money // coin[idx]
money %= coin[idx]
idx -= 1
return counter


money = 2760
ret = solution(money)

print("solution 함수의 반환 값은", ret, "입니다.")

0 comments on commit d4b0a0e

Please sign in to comment.