아미(아름다운미소)

python null 처리방법 본문

랭귀지/PYTHON

python null 처리방법

유키공 2018. 10. 29. 09:00

How to test a variable is null in python

파이썬에서 null 처리 방법

try:
    if val is None: # The variable
        print('It is None')
except NameError:
    print ("This variable is not defined")
else:
    print ("It is defined and has a value")


Comments