728x90
320x100
def solution(n):
result=''
while n :
result += str(n%3)
n=n//3
return int(result,3)
int(result, 3) -> 3진법인 result을 10진법으로 바꿔줌.
728x90
320x100
'💻 하나씩 차곡차곡 > 프로그래머스 (Python)' 카테고리의 다른 글
[프로그래머스/python/Lv1] 숫자 문자열과 영단어 (2) | 2023.12.20 |
---|---|
[프로그래머스/python/Lv1] 예산 (0) | 2023.12.19 |
[프로그래머스/python/Lv1] 부족한 금액 계산하기 (0) | 2023.12.17 |
[프로그래머스/python/Lv1] 약수의 갯수와 덧셈 (0) | 2023.12.16 |
[프로그래머스/python/Lv1] 내적 (0) | 2023.12.15 |