Category Archives: Python Programming

Python String Comparison

In this tutorial we are going to see different methods by which we can compare strings in Python. We will also see some tricky cases when the python string comparison can fail and golden rules to get string comparison always right. Python strings are Immutable.  This means that once you have created a string then… Read More »

How to Read and Write to JSON File in Python

In this tutorial we will go through the process of reading and writing JSON files in Python. While sending or receiving data between server it can only be text, so JSON (JavaScript Object Notation) is a data format used to convert JavaScript object to JSON and send it to the server. Python has a module… Read More »

Python Tic Tac Toe Game

In this tutorial we are going to see how we can implement the tic tac toe game in Python. We can either make use of random numbers for the computer move or we can develop a simple algorithm which will play the role of a computer.  Let us first see the representation of our board.… Read More »

Python Send Email Using SMTP

In this tutorial we will see how to send email using Python. We will need two python libraries for the same, smtplib will be used for making a host for sending email it will also handle routing of email between different servers. email package allows us to use HTML and other kind of text in… Read More »

Python NoneType

In this tutorial we are going to discuss about Python NoneType. Before we start discussion on NoneType let us first see what is an object. In any programming language preliminary data types are int, float, char etc. and we can create a class by mixing different data types together and the instances of these classes… Read More »

Python Check Variable Type – 3 Ways

In this tutorial we are going to learn how to check variable type in Python.  One of the features of Python is it uses Dynamic data type. It means we need not to specify which type of data the variable is going to hold. One time in our code a variable can hold integer later… Read More »

Python Global Variables

In this tutorial we will be discussing about Python global variables. A variable which is declared outside of any function i.e. in the global space is known as global variable. Global variables are useful when multiple functions need to use the same data. In C, C++ we can use and modify global variables directly in… Read More »

Python Numpy Matrix Multiplication

In this tutorial we will see python matrix multiplication using numpy (Numerical Python) library. For using numpy you must install it first on your computer, you can use package manager like pip for installing numpy. Numpy provide array data structure which is almost the same as python list but have faster access for reading and… Read More »