728x90
반응형
print(True and True)
- and 는 두 조건 모두 True여야 결과가 True가 됩니다.
print(False or True)
- or 조건 입니다. 둘 중 하나라도 참(True)면 결과를 True 가 됩니다.
print(not True)
- 앞에 not이 붙으면 반대가 됩니다. 여기서는 True의 반대, 즉 False 됩니다.
print(not True and False or not False)
-하나씩 분리해서 보면
- not True = False
- False or not False 에서 not False 는 True로 해서 False or True이니 or 조건 즉 둘 중 하나라도 True이면 True가 되죠.
728x90
반응형
'프로그램' 카테고리의 다른 글
[파이썬] 문제 : 일주일 7개 기온 정보에서 최저기온 요일 찾기 (0) | 2023.02.20 |
---|---|
[파이썬] 문제 : 호텔 예약 (0) | 2023.02.20 |
[파이썬] 문제 : 임의의 위치에 지뢰 설치(random) (0) | 2023.02.20 |
[파이썬] 문제 : input, while로 0을 입력할 때까지 반복 입력 받기 (0) | 2023.02.20 |
[파이썬] 문제 : 학생정보 입력 받고 출력하기 (0) | 2023.02.20 |
댓글