728x90
코드를 문서화하는 것, 코드 개체의 기능과 사용법에 대한 설명을 작성하는 것을 의미
독스트링 작성할때는 앞뒤에 큰 따옴표 세개 혹은 작은 따옴표 세개를 입력
def read_csv(sep, header):
'''
Returns the sum of ~~~ .
Parameters:
sep (str) : Character or regex pattern to treat as the delimiter.
header(int) : Row number(s) containing column labels.
Returns:
c (int) : Sum of ~~
'''
c = sep + header
return c
독스트링을 불러올때는__doc__로 부르면 됨
print(read_csv.__doc__)
-----------------------------
# result
Returns the sum of ~~~ .
Parameters:
sep (str) : Character or regex pattern to treat as the delimiter.
header(int) : Row number(s) containing column labels.
Returns:
c (int) : Sum of ~~
728x90
'Python > Python 기초문법' 카테고리의 다른 글
Python - Anaconda 가상환경 생성 & Jupyter lab에 연결 (0) | 2024.01.02 |
---|---|
Python - Module, Package, Library, pip (0) | 2024.01.02 |
Python - 제어문 (0) | 2024.01.01 |
Python - 함수와 클래스 (2) | 2024.01.01 |
Python - 리스트 함수 (0) | 2023.12.31 |