알고리즘/함수 in python
int형 숫자를 0을 앞에 붙인 문자열로 변경 in python
lucian
2021. 10. 27. 15:32
target=1
print(format(target,'02'))
print('{0:03d}'.format(target))
결과 :
01
001
개인적으로 밑에 것을 더 선호