Python

Python – Customize Truth Value testing

We have discussed Truth Value testing in our previous Articles “Python – Truth Value Testing” and “Python – Truth Value Testing for Class objects“. Through this article, we will discuss customizing Truth Value testing. We can customize Truth value testing by defining __bool__ and __len__ functions. Initially, Python verifies the definition of _bool_ function; if […]

Python – Exception handling

Python provides exception handling mechanism to handle the Exceptions when something went wrong in the Program. Python interpreter reads the code and throws an Exception when something went wrong; if the mechanism is provided to handle the Error, the Program execution continues, otherwise the Program terminates. Very good example of Exception is Division by Zero […]

Scroll to top