파이썬[Python]: keyword - and 키워드

내장함수 - and 키워드(keyword)


/// 설명

모든 값이 참일 경우 참(True)을 반환합니다.

※ 형식
and

reference
https://docs.python.org/3/reference/expressions.html#and

/// 예제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
= True
= True
 
= a and b
 
print(x)  # True
 
if x:
    print('x is True')  # x is True
else:
    print('x is False')
 
= False
 
= a and b and c
 
print(y)  # False
 
print('y is True' if y else 'y is False')  # y is False
# test = 'y is True' if y else 'y is False'
# print(test)
 
cs

* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)


– 당신을 응원합니다. –

댓글

이 블로그의 인기 게시물

파이썬[Python]: 내장함수 - from_bytes 메서드

파이썬[Python]: 내장함수 - __len__ 메서드

파이썬[Python]: kivy - 한글 사용

파이썬[Python]: 내장함수 - bit_length 메서드

C 언어: sin 함수, cos 함수, tan 함수