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

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

2386  

목차

  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 - statistics.mode() 메서드 ★ - 최빈값 반환. (= mode메서드 = 모드)
module Python - statistics.pstdev() 메서드 -
module Python - statistics.stdev() 메서드 -
module Python - statistics.pvariance() 메서드 -
module Python - statistics.variance() 메서드 -
module Python - math 모듈 메서드・상수 종류 (※ 수학 모듈)
module Python - math.acos() 메서드 -
module Python - math.acosh() 메서드 -
module Python - math.asin() 메서드 -
module Python - math.asinh() 메서드 -
module Python - math.atan() 메서드 -
module Python - math.atan2() 메서드 -
module Python - math.atanh() 메서드 -
module Python - math.ceil() 메서드 ★ - 천장 반올림 (= 상위 정수로 반올림. = ceil메서드…
module Python - math.comb() 메서드 -
module Python - math.copysign() 메서드 -
module Python - math.cos() 메서드 -
module Python - math.cosh() 메서드 -
module Python - math.degrees() 메서드 -
module Python - math.dist() 메서드 -
19/24
목록
찾아주셔서 감사합니다. Since 2012