How do I check for multiple exceptions in Python? -


dnasequence = "laksjfklsajdfklsajfklasjfklsad"

    while true:         lmerlength = input("please enter length of l-mers of universal array :")         try:             if len(dnasequence) >= lmerlength > 0:                 break         except syntaxerror:             pass         #this not working. how check multiple exceptions in python?         except nameerror:             pass         print "error: please check input. entered invalid input." 

here how check multiple exceptions.

try:

    .............. 

except (syntaxerror, nameerror, ...):

    .............. 

finally:

    ............. 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -