LANG/PYTHON

    [Python] string앞에 0 채우기(zfill, zjust)

    파이썬에서 숫자를 출력하고자 할 때, 앞 숫자에 0을 붙여서 출력해야하는 경우가 있다. 1. zfill(width) width만큼의 문자열 길이를 진 왼쪽이 0으로 채워진 문자열 return # "001" "1".zfill(3) # "00123" "123".zfill(5)2. rjust(width, [fillchar]) rjust는 0이 아닌 fillchar를 채울 수 있다. # "001" "1".zjust(3, "0") # "00123" "123".zjust(5, "0") # "abc123" "123",zjust(6, "abc")3. zfill 활용 exercism python track 'clock'에서 기존 코드를 zfill로 이용해 사용해보았다. if condition으로 처리했던 ..

    python 영어 문제 사이트

    exercism.io/ Exercism Code Practice and Mentorship for Everyone. Level up your programming skills with 1,879 exercises across 38 languages, and insightful discussion with our dedicated team of welcoming mentors. Exercism is 100% free forever. exercism.io 엔지니어 과정을 준비하는 곳에도 요즘 코딩테스트를 준비하는 곳이 늘었다. 영어 공부도 할겸해서 간단하게 파이썬으로 알고리즘 공부를 하는게 좋다고 생각해서... exercism이라는 자체 program을 설치해서 문제의 repo로 다운받고 제출하는 형식이 좋..