Python

python - Data Type - bool

에이미103 2019. 7. 14. 23:29

# python Data Type - bool
 - 논리 상수인 True, False를 사용
 - 다음과 같은 경우는 False로 간주
  1. 빈문자열은 논리연산시 False("")
  2. 빈 리스트([]), 빈 튜플(()), 빈 딕셔너리({})
  3. 숫자 0 False , 나머지 다른 숫자 True
  4. None => False간주

'Python' 카테고리의 다른 글

python - 날짜(date, time, datetime)  (0) 2019.07.15
python - if문  (0) 2019.07.14
python - set type  (0) 2019.07.14
python - dict  (0) 2019.07.14
python - range  (0) 2019.07.14