Category Archives: Python Programming

Solve IndexError: list index out of range in Python

Hello readers, welcome back to a yet another post of The Crazy Programmer. Today I’ll be discussing one of the common error programmers make when they start with programming and that is IndexError. Now before talking about this error, let’s try to see what an Index is and why this error occurs. An index is… Read More »

Python Read File Into List

In this tutorial we are going to see how we can read a file and store the content of the file into a python list. While working with python many a times data is stored into text files or csv files and to use that data into our code it must be brought to the… Read More »

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 »