Showing posts from April, 2015
Iterators in python: Let's start discussion about python iterator with a simple python program involving for loop. mylist = [ 1 , 4 , 6 , 7 , 98 ] for x in mylist : print x Sample output : 1,4,6,7,98 The sample program is s…
Method overloading / constructor (__init__()) overloading : Python does not support method overloading.It would be justified to say that , python does not require to support method overloading explicitly as done in other languages like java and c++…
Python support object oriented programming paradigm along with procedural programming. Classes and Objects are the two important aspects of object oriented programming. A class creates a new type (analogous to an int class of python) and objects are…
Git Revert: git revert <SHA-of-commit-to-revert> Suppose we added a piece of code in given commit and we want to remove it from commit. Git revert comes for rescue. If Git reverts given commit , then Git will make a new commit where that piec…
Why do we need to make a class serializable ? When we require an object to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object then we need to make that class serializable, so that instance of th…
Exceptions are unexpected events that occur during the execution of a program.Consider the following where exception/error occurs: >>> 10 * (1/0) #ZeroDivisionError: integer division or modulo by zero >>> 4 + spam*3 #NameErr…