반응형
반응형
zfill 사용하면 된다
ex) 날짜 포맷 만들어줄때
month = "9"
day = "24"
print(month.zfill(2)) #"09"
print(day.zfill(2)) #"24"

자리수를 초과하면 아무일없음

반응형
'🖥' 카테고리의 다른 글
| [python3] 피보나치 동적계획법 (0) | 2022.10.01 |
|---|---|
| [python3] numpy 이용 행렬의 곱셈 (0) | 2022.10.01 |
| [jquery] datepicker 여러 input에 적용하기 (0) | 2022.09.15 |
| [동적계획법] Matrix 행렬 경로 문제 (파이썬) (0) | 2022.07.10 |
| [Spring Boot] Field in required a bean of type '' that could not be found. (0) | 2022.07.04 |
댓글