Skip to content

논리 연산자

논리 연산(Logical Operators)은 두 개 이상의 조건에서 사용된다. and, or, not 연산이 있다.

a = 5, b = 3일 때 논리 연산의 결과를 알아보자.

표현예시결과
and조건이 모두 참(True)일 때 참(True)을 반환a > 3 and b < 5True
or조건 중 하나만 참(True)이면 참(True)을 반환a > 3 or b < 2True
not연산의 결과를 반대로 변경한다.not a > bFalse

Powered by vitepress-logo-mini