728x90

언어마다 주석은 정말 다양하고 다르지만 파이썬 역시나 또 다른 주석을 사용합니다...
한줄 주석은 기본적으로 #을 사용하고 쿼테이션 3개를 연달아쓰면 여러줄 주석이 되는데요.
1. 여러줄 주석
'''
REPL : Read Eval Print Loop
'''
위의 경우 여러줄 주석입니다.

색깔이 안나와서 IDLE Shell에서 부분캡쳐해서 가져와보았습니다.
이제 주석같죠?
또한 파이썬은 '(single quotation)과 "(double quotation)의 차이가 없습니다.
"""
EPL : Read Eval Print Loop
"""
이 경우도 주석처리됩니다.

2. 한줄 주석
# 주석
한줄 주석은 #을 사용합니다.

간단하죠??
728x90
'Python > Python' 카테고리의 다른 글
[Python] list(리스트) (0) | 2022.04.27 |
---|---|
[Python] 문자열(string) (0) | 2022.04.26 |
[Python] 숫자형(number) 타입 (0) | 2022.04.25 |
[Python] 변수(variable)와 타입(type) (0) | 2022.04.24 |
[Python] 파이썬 설치하기! (0) | 2022.04.22 |