Back
val = "" del val if val is None: print("null")
val = ""
del val
if val is None:
print("null")
I ran above code but got NameError: name 'val' is not defined.
How to decide whether a variable is null, and avoid NameError?
You can check if val is None by using the below mentioned piece of code:-
if val is None: pass
pass
To know more about this you can have a look at the following video tutorial:-
31k questions
32.8k answers
501 comments
693 users