길/Python

not sth in list / sth not in list

7he8oy 2021. 2. 10. 22:34
nums = [1, 2, 3]
print(not 4 in nums) #True
print(4 not in nums) #True
print(not 3 in nums) #False
print(3 not in nums) #False

' > Python' 카테고리의 다른 글

dic.get(key [,default])  (0) 2021.02.11
try / except / finally / assert  (0) 2021.02.11
List Functions  (0) 2021.02.10
True or False and True  (0) 2021.02.10
// - 나누셈 후 소수점 이하를 버리는 연산자  (0) 2021.02.09