I am in the process of learning Python and I have reached the section about the pass statement. The guide I\'m using defines it as being a Null sta
If you want to import a module, if it exists, and ignore importing it, if that module does not exists, you can use the below code:
try:
import a_module
except ImportError:
pass
#rest of your code
If you avoid writing the pass statement and continue writing the rest of your code, a IndentationError would be raised, since the lines after opening the except block are not indented