Category Python Tutorial

Python is a high-level, interactive, object-oriented and interpreted scripting language. It was designed to have a readable source code and it uses English keywords more frequently where other programming languages use punctuation.

Python Generator

This article aims to provide a somewhat gentle introduction to python generator, and hopefully will inspire the reader to find interesting uses for them. It is a somewhat complicated topic with a lot of small details, so we will use…

Exception handling in Python 3.5

In this article I will introduce you to exception handling. In the previous articles in this series we use exception handling to cover some rare exception cases (remember the Guess the Number game?) and now it is time to explain…

Python setup for Windows, Mac, Linux

Python is available for various platforms which includes Linux, Windows and Mac OS. So here we are going to understand how to setup python environment. For the local environment setup open the terminal window and type there “python” to know…

Python date comparison

Comparing dates (or datetime objects) in Python is very easy. The basic comparison operators (==, !=, <>, >, <, >=, <=) are overloaded for the datetime object, so comparing dates is very intuitive and quick.

Dates and times with Python

Sometimes we have to work with dates and times. I use dates less than times because with times you can measure code execution time which is sometimes essential (for my website scraping book’s performance measurement is the core part I…

Object-Oriented Programming (OOP)

Now we arrived at object-oriented programming. This has (had) its hype where every language was designed around objects and Python developer Guido van Rossum thought “Why not?” and added classes to support object-oriented development. Some python evangelists think this was…

Python 3: Guess the number –The return

We have seen this example previously. There I included a lot of loops to handle user input and the main logic… Now it is time to refactor the application to use functions. This should make the code readable and we…

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…