
항상 If is None / If is not None 만 확인했었는데 If / If not이라는 개념이 있다는 걸 이제 알았다..😂
If / If not 너무 유용
None뿐만 아니라 빈값으로 생각되는 경우, False의 경우는 모두 If not에 들어감
오직 None인 경우에만 해당됨
A = "" # 1, 4
A = True # 2, 4
A = False # 1, 4
A = None # 1, 3
A = 0 # 1, 4
A = '0' # 2, 4
A = [] # 1, 4
A = {} # 1, 4
A = 2
# 1
if not A: # "", False, None, 0, [], {}
print("if not A")
# 2
if A: # True, '0'
print("if A")
# 3
if A is None: # Only None
print("if A is None")
# 4
if A is not None: # None이 아닌 모든 경우
print("if A is not None")