불리언 연산자

금융을 위한 중급 Python

Kennedy Behrman

Data Engineer, Author, Founder

불리언 논리

조지 불

금융을 위한 중급 Python

불리언 연산은?

  1. and
  2. or
  3. not
금융을 위한 중급 Python

객체 평가

False로 평가됨

  • 상수:

    • False
    • None
  • 숫자 0:

    • 0
    • 0.0
  • 길이 0

    • ""
    • []
    • {}

True로 평가됨

  • 그 외 대부분
금융을 위한 중급 Python

AND 연산자

True and True
True
True and False
False
금융을 위한 중급 Python

OR 연산자

False or True
True
True or True
True
False or False
False
금융을 위한 중급 Python

단락 평가

is_current() and is_investment()
False
is_current() or is_investment()
True
금융을 위한 중급 Python

NOT 연산자

not True
False
not False
True
금융을 위한 중급 Python

NOT의 연산 순서

True == False
False
not True == False
True
금융을 위한 중급 Python

객체 평가

"CUSIP" and True
True
금융을 위한 중급 Python

객체 평가

[] or False
False
금융을 위한 중급 Python

객체 평가

not {}
True
금융을 위한 중급 Python

객체 반환

"Federal" and "State"
"State"
[] and "State"
[]
금융을 위한 중급 Python

객체 반환

13 or "account number"
13
0.0 or {"balance": 2200}
{"balance": 2200}
금융을 위한 중급 Python

Let's practice!

금융을 위한 중급 Python

Preparing Video For Download...