Difference between revisions of "Python:Control structures"
Jump to navigation
Jump to search
(Created page with "Category:Python To catch all exceptions (not wise) ==Exception handling== <syntaxhighlight lang=python> try: block except: blockifexceptionisthrown </syntaxhighli...") |
(No difference)
|
Revision as of 23:13, 22 January 2018
To catch all exceptions (not wise)
Exception handling
try:
block
except:
blockifexceptionisthrown
You better only catch the exceptions you expect. You can choose from the available exceptions [1]
- except NameError
- The variable does not exist