• 회원가입
  • 로그인
  • 구글아이디로 로그인

[keyword] Python - not 키워드 - 조건 결과의 역을 반환하는 논리연산자. (= not연산자)

2392  

목차

  1. not 예제 -  조건 결과의 역 반환
  2. not 정의
  3. not 예제 - cf. not in 키워드

 

not 예제 -  조건 결과의 역 반환


x = False

print(not x)

 

결과값: True

 

not 정의

 

구문 결과의 역을 반환하는 논리연산자.

(즉, 구문이 참이 아니면 True 반환, 구문이 참이면 False 반환.)

 


 

1. cf.

  • and 연산자 : 조건이 모두 참이면 True, 그외는 False.
  • or 연산자 : 조건이 하나라도 참이면 True, 모두 거짓이면 False.

 

2. cf.

  • not in 구문 : in 연산자의 반대

 

 

not 예제 - cf. not in 키워드

 

codes = ["HTML", "CSS", "JS"]

if "Python" not in codes:

  print("없음")

 

결과값: 없음



분류 제목
module Python - cmath.sinh(x) 메서드 -
module Python - cmath.sqrt(x) 메서드 -
module Python - cmath.tan(x) 메서드 -
module Python - cmath.tanh(x) 메서드 -
module Python - cmath.e 상수 - 오일러 상수 (2.71...)
module Python - cmath.inf 상수 - float 자료형의 무한대 상수 (= inf) 반환.
module Python - cmath.infj 상수 - complex 자료형의 무한대 상수 (= infj) 반환.
module Python - cmath.nan 상수 - float 자료형의 nan 상수 (= nan) 반환.
module Python - cmath.nanj 상수 - complex 자료형의 nan 상수 (= nanj) 반환.
module Python - cmath.pi 상수 - 원주율 (= 3.14...) 반환. (= 파이 상수)
module Python - cmath.tau 상수 - 원주율 2배 (= 6.28...) 반환. (= 타우 상수)
howto Python - digit 숫자 (0~9)를 정사각형 형태로 나열.
pandas Python - Pandas Intro (판다스 소개)
pandas Python - Pandas Start (설치/시작/버전확인)
pandas Python - Pandas Series (시리즈)
pandas Python - Pandas DataFrames (데이터프레임)
pandas Python - Pandas Read CSV (CSV 읽기)
pandas Python - Pandas Read JSON (JSON 읽기)
pandas Python - Pandas Analyzing DataFrames (데이터프레임 분석)
pandas Python - Pandas Cleaning Data (데이터 청소/정리)
23/24
목록
찾아주셔서 감사합니다. Since 2012