Exceptional handling for Name Error

# If x is not defined itself the program not terminated
try:
    y=50*x
except NameError:
    x=1
    y=50*x
    print y
   

No comments: