728x90
반응형
string
0~9 까지 숫자, a~z까지 알파벳을 일일이 적지않고 바로 가져올 수 있다.
알면 꽤 편리한 라이브러리다.
import string
string.ascii_lowercase # 소문자 abcdefghijklmnopqrstuvwxyz
string.ascii_uppercase # 대문자 ABCDEFGHIJKLMNOPQRSTUVWXYZ
string.ascii_letters # 대소문자 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
string.digits # 숫자 0123456789
참고) 공식 문서
6.1. string — Common string operations — Python 3.4.10 documentation
6.1. string — Common string operations Source code: Lib/string.py 6.1.1. String constants The constants defined in this module are: string.ascii_letters The concatenation of the ascii_lowercase and ascii_uppercase constants described below. This value is
docs.python.org
반응형
'Python > 라이브러리' 카테고리의 다른 글
파이썬(python) 라이브러리 - sphinx (docstirng 자동 문서화) (0) | 2021.08.12 |
---|---|
파이썬(python) 라이브러리 - heapq (0) | 2021.05.07 |
파이썬(python) 라이브러리 - collections.deque (0) | 2021.04.22 |
파이썬(python) 라이브러리 - bisect (이진탐색, 바이너리 서치, Binary Search) (0) | 2021.04.21 |
파이썬(python) 라이브러리 - collections.Counter (0) | 2021.04.21 |