Anonymous user
Undefined values: Difference between revisions
→{{header|Python}}: Modified comments to stress creation/deletion. There is no 'undefined' value to give.
(→{{header|Python}}: Modified comments to stress creation/deletion. There is no 'undefined' value to give.) |
|||
Line 352:
=={{header|Python}}==
<lang python># Check to see whether
try: var
except NameError: print "var is undefined at first check"
#
var = "Chocolate"
# Check to see whether
try: var
except NameError: print "var is undefined at second check"
#
del var
# Check to see whether it is defined after
try: var
except NameError: print "var is undefined at third check"
#
var = 42
# Check to see whether the
try: var
except NameError: print "var is undefined at fourth check"
|