L
Louis.Soninhu
code sample:
----------------------------------------------
i=input()
try:
x=int(i)
print "you input an integer"
except ValueError:
print "you must input an integer"
------------------------------------------------
when I input a value like, b
I got the traceback message instead of proper exception handling:
NameError: b is not defined
I also tried
----------------------------------------------
i=input()
try:
x=int(i)
print "you input an integer"
except ValueError:
print "you must input an integer"
------------------------------------------------
when I input a value like, b
I got the traceback message instead of proper exception handling:
NameError: b is not defined
I also tried