Python Tutorial

Python Tutorial for beginners to learn Python online for free.

Python is a powerful, popular, multi-purpose programming language. Today, Python is the most used programming language for general-purpose, web development, app development, data science. Python is free to use and easy to learn because of its simple syntax.

Python Tutorial covers Python basics & advanced concepts with examples such as Variables, Loops, Operators, Modules, Functions, Objects, List etc. This Python tutorial is well crafted for beginners as well as professionals.

In this online Python training course, you will learn how to use Python to create programs and applications. You will also find useful exercise, codes, Interview Questions to enhance your knowledge at the end of the most chapters.

Python Introduction

Python is a popular, high-level programming language that is easy to read and easy to learn. It is free, open source and runs on Windows, macOS and Linux. Many beginners start programming…

Python Syntax

The Syntax of Python language is simple and clean. In this tutorial, see a Python program to print ‘Hello World’ and start learning Python programming

Python Comments

As we know that python is an easier programming language than the other programming languages. But if we talk about large projects or team projects, then it difficult to understand the codes…

Python Variables

Python Variables are used to store some data or values in the program. These variables are actually reserved memory locations whose values can be changed later during program execution. Unlike other programming…

Python Data Types

Python Data Types are the identity of the values stored in variables. With the help of Python Data Types, we can define the type of variables. There are lots of data types…

Python Type Casting

Type casting means changing a value from one data type to another. For example, the text “25” is a string, and with type casting you can turn it into the number 25…

Python input() Function

There are many ways to take input from users such as from the keyboard, database, another computer, or mouse clicks.In python programming, we can take the input from the user with the…

Python Operators

Python Operators performs a mathematical, relational or logical operation on variables. In this Python Tutorial, learn Type of Operators with examples.

Python Strings

A string is a sequence of characters, like a word, a sentence or even a whole paragraph. In Python a string is written inside single quotes or double quotes. Strings are one…

Python Conditional Statements

Python Conditional Statement helps you to perform different actions based on some conditions. Learn more about Python if, elif, nested if, else conditions

Python While Loop

while loop is a control flow statement that allow to execute the code until the given condition is false. Sometimes, we need to execute a statement more than one time. We can…

Python for loop

Python ‘for’ loop iterate over Python sequence such as list, tuple, set, string etc for certain conditions. Learn loops in Python with range(), break, continue statements.

Python Functions

A function is a block of code that has a name and does one job. It runs only when you call it. Functions help you avoid writing the same code again and…

Python Lists

Python list used to store the collection of data in a single variable, then there are four ways to store the data in python programming one of them is Python Lists. In…

Python Tuples

Python Tuples are the collection of multiple data like the list. The main difference between the list and the tuple is that the value of a tuple element can’t be updated means…

Python Sets

Python Sets are the collection of multiple data like the list and tuple. The main difference between the list and the Python Sets is that the set elements are unordered and unindexed….

Python Dictionary

Python Dictionary is the collection of multiple data like the list and tuple. The main difference between the list and the dictionary is that a dictionary stores its data as key:value pairs,…

Python Built-in Functions

Python Built-in functions are standard library functions that are part of language itself. There are lots of built-in functions in Python programming. Built-in functions help in the optimisation, as they have clean…

Python OOPS – Introduction

OOPS (Object-Oriented Programming System) is a way of writing programs using objects. An object is a thing that has some data (properties) and some actions (methods). For example, a car has a…

Python Classes and Objects

A class is a blueprint for creating objects, and an object is one real copy created from that blueprint. Almost everything in Python is an object, like numbers, strings and lists. If…

Python Object Methods

An object method is a function that is defined inside a class and belongs to the objects of that class. We use it to give behaviour to an object, like a Person…

Python Inheritance

Inheritance allows a class to take the properties and methods of another class. The class that gives is called the parent class (or base class), and the class that receives is the…

Polymorphism in Python

Polymorphism means “many forms”. In programming it means that the same function name, method or operator can work in different ways for different types of objects. Python uses polymorphism in many places,…

Python Lambda

A lambda is a small function without a name (an anonymous function), written in one line with the lambda keyword. Python took this idea from functional programming. Syntax A lambda can take…

Python map() Function

The map() function applies a function to every item of an iterable (like a list or tuple) and returns a map object, which is an iterator. You can turn it into a…

Python reduce() Function

The reduce() function takes a function and a sequence, and combines all the items into a single value. It works from left to right: it applies the function to the first two…

Python filter() Function

The filter() function goes through every item of an iterable, runs a test function on it, and keeps only the items for which the test returns True. It returns a filter object…

Python Decorators

Python decorator is a callable object-like function, it is used to modify a function and class. A reference to a function “func” and class “C” pass to decorator and it will return…

Scope of Variables in Python

Python variables are used to store the different type of data. We first need to assign a data to variable and then we can use inside anywhere in program. Example of Python…

Pass function as an argument in Python

In Python a function is an object, just like a number or a string. So you can store a function in a variable, pass it to another function as an argument, and…

Python Closures

A closure is an inner function that remembers the values of the variables of its outer function, even after the outer function has finished running. To understand it, first learn what a…

Python Iterators and Generators

When you write a for loop over a list, Python takes the items one by one. This one-by-one working is done by an iterator. A generator is an easy way to create…

Python Errors

An error is a problem in a program that stops it or gives a wrong result. Every programmer meets errors daily, so it is important to understand them. The process of finding…

Python Jump Statements

Jump statements change the normal flow of a loop. Python has three of them: break, continue and pass. You use them inside for and while loops. Statement What it does break Stops…

Python Access Modifiers

Access modifiers decide who can use the variables and methods of a class. Languages like Java have keywords for this, but Python has no strict rules. Instead, Python uses naming conventions with…

Python Modules

A module is a Python file that has functions, classes or variables you can use in other programs. Modules help you split a big program into small files, and reuse the same…

Python MySQL – Connect

Python can work with a MySQL database using a driver (a library). In this series we use the official mysql-connector-python driver. We will use the same example as in our PHP MySQL…

Python MySQL – Create Table

To create a table in MySQL from Python, we run the SQL CREATE TABLE command with the cursor. Before this, you should know how to connect Python to MySQL. Create the users…

Python MySQL – Insert Data

We add data to a MySQL table with the SQL INSERT INTO command. This chapter uses the users table created in the previous chapter. Insert one row %s is a placeholder. MySQL…

Python MySQL – Select Data

To read data from a MySQL table we run a SELECT query and then fetch the rows from the cursor. We use the users table with the three rows added in the…

Python MySQL – Update and Delete Data

To change or remove existing rows we use the SQL UPDATE and DELETE commands. Like INSERT, they need conn.commit() to save the change. We continue with the users table from the previous…

Python File Handling

A file handling mechanism is used to store the output of a program inside a file and to perform various operations (write, read, and delete) on it.Python supports the file handling concept that allows…