728x90
Python에서 여백넣기(Python Indentations)
- 여백 넣기는 하위코드블록(a block of code)을 나타냄
- 4칸의 공백을 권장 / (Tab키)
- Python은 들여쓰기가 엄격하다.
if 5>2:
print("This is a sub block")
print("Five is greater than two")
실행 결과
This is a sub block
Five is greater than two
if 5<2:
print("Five is greater than two")
실행 결과
Five is greater than two
Python에서 주석(Comment)
- # 이후 한 줄 주석
# 한 줄 주석
print("Hellow, World!")
실행 결과
Hellow, World!
print("Hellow, World!") # 주석 입력하기
실행 결과
Hellow, World!
'Language > Python' 카테고리의 다른 글
[Python] print() 함수를 사용한 다양한 출력 (0) | 2022.06.27 |
---|---|
[Python] Python Error (0) | 2022.06.27 |
[Python] 파이썬이란? (0) | 2022.06.27 |
[Python] 예외 처리(exception handling) (0) | 2022.06.26 |
[Python] 파일 입출력 (0) | 2022.06.25 |