Showing posts from April, 2015

Iterators and Generators in python

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 and Operator overloading

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++…

Object oriented programming in python - Class and Object

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…

Exception handling in python - try/except/else/finally

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…

Load More
That is All