강의 회차 : #3. 3 And & Or ~ #3.7 Recap
1. And
조건문 전체가 True여야 True임, 즉 다중 조건문중 False가 들어있다면 해당 조건문은 False로 동작
2. Or
조건문 중 하나만 True면 True로 동작한다.
조건문1 | 조건문2 | AND문 | OR문 |
True | True | True | True |
True | False | False | True |
False | True | False | True |
False | False | False | False |
3.Python Standard Library
The Python Standard Library
While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It...
docs.python.org
파이썬은 기본적으로 내장되는 Build-in Functions 그룹외에 다양한 함수를 제공한다.
그러나 해당 함수를 사용을 위해서는 module을 import를 해줘야한다.
아래는 random 모듈에서 randint 함수를 사용하는 예제이다.
4.While(반복문)
while 조건문:
실행문
조건문이 참일경우 반복해서 실행문을 실행한다.
5. 기타
5-1 ) input 함수
쉘스크립트에서 read랑 비슷한 역할 Argument를 입력 받을수 있음
test_input = int(input("값을 입력하세요"))
print ("입력된 값은 ",test_input,"입니다")
5-2) 주석 처리 #,"""
한줄단위 주석할경우 내용앞에 해시태그 #
전체 라인 주석 """(쌍따옴표 3개)
전체 주석 처리되어 콘솔값에 아무것도 보이지않음
'Study > Python' 카테고리의 다른 글
Python 공부 6일차 (0) | 2024.03.14 |
---|---|
Python 공부 5일차 (0) | 2024.03.13 |
Python 공부 목표 (0) | 2024.03.07 |
Python 공부 3일차 (0) | 2024.03.07 |
Python 공부 2일차 (0) | 2024.03.06 |