Object Oriented Programming in Python

As in Python it is not necessary to create our code into classes while developing program as we can use functions also which is known as Procedural Programming. However, a procedural programming is used for writing small, short and simple programs whereas object oriented programming (OOP) programs becomes more important as the programs grows in size and complexity. The Python has been the object oriented language since it is developed. Continue reading

Python function

Now we have learned the basics of Python programming: variables, collections and loops. If you have followed the examples and the tutorial you might feel that sometimes we use too much code and it can be leveraged a bit. But maybe you do not know how to do it.

Most of the time the solution is to introduce functions. We have encountered functions of other modules which we used just like isupper() of strings or choice() of the random module.

If you have learned mathematics then you know about functions already. Mathematicians can do very nasty things with them but programmers too. The aim of a function is to produce a result which is determined only by the parameters passed to the function. Continue reading