Question:

Which statement of Python is used whenever a statement is required syntactically but the program needs no action?

Answer:

Pass – is no-operation / action statement in Python
If we want to load a module or open a file, and even if the requested module/file does not exist, we want to continue with other tasks. In such a scenario, use try-except block with pass statement in the except block.
Eg:

 try:import mymodulemyfile = open(“C:\myfile.csv”)except:pass

Keywords:

© 2017 QuizBucket.org