Category Archives: Python Basics

Comments in Python

In this tutorial, we will learn about Comments in Python. Comments are not used to perform any function in the program but they really useful for developers. Developers can write comments with variables and functions to remember their working (purpose) in the program. One important thing to mention comments doesn’t put any impact on the execution of program… Read More »

Exception Handling in Python

In this tutorial, we will learn about Exception Handling in Python. Before going into the depth we have a very important question, “What is Exception?”. And the answer to this question is very simple. In the normal way we know exception means the abnormal situation. But in python, Exception is an event which occurs while execution of the program and… Read More »

Directory in Python

In this tutorial, we would learn about the Directory in Python. In Directories, we can store files and subdirectories. Directories help us to manage a large amount of files of our project. There is an os module in Python which provides us with methods to work with Directories. Get Current Directory: Here will we will learn how we can… Read More »

Classes and Objects

In this tutorial, we would learn about Classes and Objects in Python. Python is an Object-Oriented programming language. If you have ever learned any Object Oriented Programming language like Java or C# before then you have an idea how classes and objects work.Those who never learned Object Oriented programming language before. In OOP we keep related things(Data and methods)… Read More »

Functions in Python

In this tutorial, we would learn about Functions in Python. A function is a block of code which allow us to reuse code. Python provides us rich collection of in-built functions like print(), mkdir(), rmdir() etc. which we can use by just calling them. In Python, we can create our own functions. This kind of functions known as user-defined… Read More »

Looping Statements in Python

In this tutorial, we would learn about Looping Statements in Python. Looping statements help us to run a block of code for several times. For example, you want to show “Hello World” a hundred times. It means you have to write print(“Hello World”) statement a hundred times. This will be soo boring and time-consuming. But with the help of… Read More »

String in Python

In this tutorial, we would learn about String in Python and Different String methods in Python. A string is a collection of characters. A String can contain alphabets, numbers or special characters. For example, the name of a person or address of a location can be store in a String. How to create a String in Python: To Create… Read More »

Tuple in Python

In this tutorial, we will learn Tuple in Python. In the last tutorial, we learned about List. Tuples are same as Lists except for one difference that we cannot change elements of tuple after assigning them. In the case of the list we know we can change List elements very easily. It means you can say Tuple is a… Read More »

List in Python

In this tutorial, we will learn about List in Python. The list is similar to arrays except one difference List can contain a heterogeneous type of data(Integer, Strings and Object) in single list. In list we add list element according to index number. The first element of the list will always save on 0 index. Indexing of list is… Read More »