
def solution(x):
a = str(x)
total = 0
for i in range(0,len(a)):
total += int(a[i])
if x%total == 0:
return True
else:
return False'코딩테스트 > Python' 카테고리의 다른 글
| [프로그래머스/Python] 없는 숫자 더하기 (0) | 2025.09.24 |
|---|---|
| [프로그래머스/Python] 음양 더하기 (0) | 2025.09.24 |
| [프로그래머스/Python] 정수 제곱근 판별 (0) | 2025.09.23 |
| [프로그래머스/Python] 문자열 내 p와 y의 개수 (0) | 2025.09.22 |
| [프로그래머스/Python] 두 정수 사이의 합 (0) | 2025.09.22 |