Beakjoon&프로그래머스/파이썬
[백준/파이썬] 5949번 Adding Commas
현장
2022. 12. 6. 22:34
-Code
num = input()[::-1]
result = ""
for i in range(len(num)):
result += num[i]
if (i + 1) % 3 == 0 and i != len(num) - 1:
result += ","
print(result[::-1])