Vijaykrishna Ram

Vijaykrishna Ram

Python Custom Exceptions

An Exception is raised whenever there is an error encountered, and it signifies that something went wrong with the program. By default, there are many exceptions that the language defines for us, such as TypeError when the wrong type is…

Python setattr() Function

Python setattr() function is used to set the attribute of an object, given its name. While being a very simple function, it can prove to be very useful in the context of Object Oriented Programming in Python. Let us look…

Python Template Strings

Python’s Template String Class provides a way for simple string substitution, wherein the template fields are substituted with suitable replacement strings provided by the user. Sometimes, it may be a preference to have an easier to replace string, rather than…

Python filter() function

Python’s filter() function is used to filter the elements of an iterable (sequence) with the help of a predicate that tests each element on the iterable. A predicate is a function that always returns True or False. We cannot use…