udemy.py_Section 4 - (1) Python Operators

Gomi_kery·2022년 9월 11일

udem.py

목록 보기
14/28
post-thumbnail

비교 연산자

1 == 1					# True
'hello' == 'Hello' 		# False
100 == '100'			# False



논리 연산자

and 연산자

A and B

  • A와 B, 모두 참이면 : True 반환
  • A와 B, 중 하나라도 거짓이면 : False 반환
True and True			# True
True and False			# False
False and True			# False
False and False			# False

or 연산자

A or B

  • A와 B, 중 하나라도 참이면 : True 반환
  • A와 B, 모두 거짓이면 : False 반환
True or True			# True
True or False			# True
False or True			# True
False and False			# False

not 연산자

not A

  • 조건을 반대로
  • A가 참이면 : False / 거짓이면 : True
not True				# False
not False				# True
profile
QA. 손으로 할 수 있는 모든 것을 좋아합니다.

0개의 댓글