Qus : How can assertions be disabled in Python?
Qusपायथन में अभिकथनों को कैसे अक्षम किया जा सकता है?
A. Passing –O when running python B. Assertions are disabled by default
C. Both A and B are wrong D. Assertions cannot be disabled in python
Solution
A. Passing –O when running python
Explanation
Assertions in Python can be disabled by running the Python interpreter in optimized mode. This is done by using the -O (capital letter "O", not zero) flag when starting the interpreter. When Python is run with this flag, all assert statements in the code are ignored.