Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 코딩테스트
- 파이썬
- 프로그래머스
- 실기
- pandas
- level 1
- 실습
- 빅데이터 분석 기사
- oracle
- matplotlib
- Numpy
- SQL
- seaborn
- Oracel
- 튜닝
- Kaggle
- 카카오
- 빅분기
- 알고리즘
- sklearn
- 머신러닝
- 데이터 분석
- R
- 오라클
- Python
- python3
- level 2
Archives
- Today
- Total
라일락 꽃이 피는 날
[Python] 조건문 본문
728x90
if 조건문
if 조건식:
(Tab → indent 들여쓰기) 수행 코드
if True : if문에 종속되어있는 코드를 실행
if False : if문에 종속되어있는 코드를 실행 X
if 조건식:
print('if문의 조건식이 참이면 수행')
if ~ else
if 조건식:
print('if문의 조건식이 참이면 수행')
else:
print('if문의 조건식이 거짓이면 수행')
print('if문과 별개적으로 수행')
if ~ elif ~ else
if 조건식:
print('if문의 조건식이 참이면 수행')
elif 조건식:
print('elif문의 조건식이 참이면 수행')
else:
print('if문과 elif문의 조건식이 거짓이면 수행')
중첩 if문
if 조건식1:
if 조건식2:
print('if문의 조건식1과 조건식2가 참이면 수행')
print('if문의 조건식1이 참이면 수행')
728x90
'프로그래밍 > Python' 카테고리의 다른 글
[Python] tuple (튜플) (0) | 2021.05.30 |
---|---|
[Python] 반복문 (0) | 2021.05.21 |
[Python] random (0) | 2021.05.21 |
[Python] 연산자 (0) | 2021.04.23 |
[Python] 입력 함수 input() (0) | 2021.04.23 |