I’m very new to python so I have very simple doubt. Here is my code:
a=sri
try:
print a
except Exception:
print 'you have not put quotes for string'
else:
print 'dont know what error it is'
How to write a manual exception/error handling for this?
The code for which you need to handle errors should be written in the
tryclause. Theexceptclause is where you write how to handle the possible exceptions.More on
trystatement from python docs.