🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
All Subjects
Free · 194 Topics · No Signup

Python Notes

History to OOPs & Exception Handling — written by CodingNow 2.0's mentors. Free to read, structured to actually help you learn.

Python notes by CodingNow 2.0 cover 194 topics — from python home to mongodb limit — each explained with short definitions, syntax and runnable code examples. They are 100% free, need no signup, and work as quick revision for college exams, Python interviews and CodingNow 2.0's mentor-led Python course in Pitampura, Delhi.

No notes found. Try a different search term, or browse all Python notes.

Python Tutorial

101 of 101 topics published
1

Python HOME

Python is a popular programming language.

2

Python Intro

Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.

3

Python Get Started

At W3Schools, you can try Python without installing anything.

4

Python Syntax

As we learned in the previous page, Python syntax can be executed by writing directly in the Command Line:

5

Statements

A computer program is a list of "instructions" to be "executed" by a computer.

6

Python Output

You have already learned that you can use the print() function to display text or output values:

7

Print Numbers

You can also use the print() function to display numbers:

8

Python Comments

Comments can be used to explain Python code.

9

Python Variables

Variables are containers for storing data values.

10

Variable Names

A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume).

11

Assign Multiple Values

Python allows you to assign values to multiple variables in one line:

12

Output Variables

The print() function is often used to output variables.

13

Global Variables

Variables that are created outside of a function (as in all of the examples in the previous pages) are known as global variables.

14

Python Data Types

In programming, data type is an important concept.

15

Python Numbers

Variables of numeric types are created when you assign a value to them:

16

Python Casting

There may be times when you want to specify a type on to a variable. This can be done with casting. Python is an object-orientated language, and as such it uses

17

Python Strings

Strings in python are surrounded by either single quotation marks, or double quotation marks.

18

Slicing Strings

You can return a range of characters by using the slice syntax.

19

Modify Strings

Python has a set of built-in methods that you can use on strings.

20

Concatenate Strings

To concatenate, or combine, two strings you can use the + operator.

21

Format Strings

As we learned in the Python Variables chapter, we cannot combine strings and numbers like this:

22

Escape Characters

To insert characters that are illegal in a string, use an escape character.

23

String Methods

Python has a set of built-in methods that you can use on strings.

24

Python Booleans

Booleans represent one of two values: True or False .

25

Python Operators

Operators are used to perform operations on variables and values.

26

Arithmetic Operators

Arithmetic operators are used with numeric values to perform common mathematical operations:

27

Assignment Operators

Assignment operators are used to assign values to variables:

28

Ternary Operator

The ternary operator allows you to assign one value if a condition is true, and another if it is false:

29

Comparison Operators

Comparison operators are used to compare two values:

30

Logical Operators

Logical operators are used to combine conditional statements:

31

Identity Operators

Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location:

32

Membership Operators

Membership operators are used to test if a sequence is presented in an object:

33

Bitwise Operators

Bitwise operators are used to compare (binary) numbers:

34

Operator Precedence

Operator precedence describes the order in which operations are performed.

35

Python Lists

Lists are used to store multiple items in a single variable.

36

Access List Items

List items are indexed and you can access them by referring to the index number:

37

Change List Items

To change the value of a specific item, refer to the index number:

38

Add List Items

To add an item to the end of the list, use the append() method:

39

Remove List Items

The remove() method removes the specified item.

40

Loop Lists

You can loop through the list items by using a for loop:

41

List Comprehension

List comprehension offers a shorter syntax when you want to create a new list based on the values of an existing list.

42

Sort Lists

List objects have a sort() method that will sort the list alphanumerically, ascending, by default:

43

Copy Lists

You cannot copy a list simply by typing list2 = list1 , because: list2 will only be a reference to list1 , and changes made in list1 will automatically al

44

Join Lists

There are several ways to join, or concatenate, two or more lists in Python.

45

List Methods

Python has a set of built-in methods that you can use on lists.

46

Python Tuples

Tuples are used to store multiple items in a single variable.

47

Access Tuples

You can access tuple items by referring to the index number, inside square brackets:

48

Update Tuples

Tuples are unchangeable, meaning that you cannot change, add, or remove items once the tuple is created.

49

Unpack Tuples

When we create a tuple, we normally assign values to it. This is called "packing" a tuple:

50

Loop Tuples

You can loop through the tuple items by using a for loop.

51

Join Tuples

To join two or more tuples you can use the + operator:

52

Tuple Methods

Python has two built-in methods that you can use on tuples.

53

Python Sets

Sets are used to store multiple items in a single variable.

54

Access Set Items

You cannot access items in a set by referring to an index or a key.

55

Add Set Items

Note: Once a set is created, you cannot change its items, but you can add new items.

56

Remove Set Items

To remove an item in a set, use the remove() , or the discard() method.

57

Loop Sets

You can loop through the set items by using a for loop:

58

Join Sets

There are several ways to join two or more sets in Python.

59

Frozenset

frozenset is an immutable version of a set.

60

Set Methods

Python has a set of built-in methods that you can use on sets.

61

Python Dictionaries

Dictionaries are used to store data values in key:value pairs.

62

Access Items

You can access the items of a dictionary by referring to its key name, inside square brackets:

63

Change Items

You can change the value of a specific item by referring to its key name:

64

Add Items

Adding an item to the dictionary is done by using a new index key and assigning a value to it:

65

Remove Items

There are several methods to remove items from a dictionary:

66

Loop Dictionaries

You can loop through a dictionary by using a for loop.

67

Copy Dictionaries

You cannot copy a dictionary simply by typing dict2 = dict1 , because: dict2 will only be a reference to dict1 , and changes made in dict1 will automatica

68

Nested Dictionaries

A dictionary can contain dictionaries, this is called nested dictionaries.

69

Dictionary Methods

Python has a set of built-in methods that you can use on dictionaries.

70

Python If...Else

Python supports the usual logical conditions from mathematics:

71

Python Elif

The elif keyword is Python's way of saying "if the previous conditions were not true, then try this condition".

72

Python Else

The else keyword catches anything which isn't caught by the preceding conditions.

73

Shorthand If

If you have only one statement to execute, you can put it on the same line as the if statement.

74

Logical Operators

Logical operators are used to combine conditional statements. Python has three logical operators:

75

Nested If

You can have if statements inside if statements. This is called nested if statements.

76

Pass Statement

if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error.

77

Python Match

The match statement is used to perform different actions based on different conditions.

78

Python While Loops

With the while loop we can execute a set of statements as long as a condition is true.

79

Python For Loops

A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

80

Python Functions

A function is a block of code which only runs when it is called.

81

Python Arguments

Information can be passed into functions as arguments.

82

Python *args / **kwargs

By default, a function must be called with the correct number of arguments.

83

Python Scope

A variable is only available from inside the region it is created. This is called scope.

84

Python Decorators

Decorators let you add extra behavior to a function, without changing the function's code.

85

Python Lambda

A lambda function is a small anonymous function.

86

Python Recursion

Recursion is when a function calls itself.

87

Python Generators

Generators are functions that can pause and resume their execution.

88

Python Range

The built-in range() function returns an immutable sequence of numbers, commonly used for looping a specific number of times.

89

Python Arrays

Note: Python does not have built-in support for Arrays, but Python Lists can be used instead.

90

Python Iterators

An iterator is an object that contains a countable number of values.

91

Python Modules

Consider a module to be the same as a code library.

92

Python Dates

A date in Python is not a data type of its own, but we can import a module named datetime to work with dates as date objects.

93

Python Math

Python has a set of built-in math functions, including an extensive math module, that allows you to perform mathematical tasks on numbers.

94

Python JSON

JSON is a syntax for storing and exchanging data.

95

Python RegEx

A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern.

96

Python PIP

PIP is a package manager for Python packages, or modules if you like.

97

Python Try...Except

The try block lets you test a block of code for errors.

98

Python String Formatting

F-String was introduced in Python 3.6, and is now the preferred way of formatting strings.

99

Python None

None is a special constant in Python that represents the absence of a value.

100

Python User Input

That means we are able to ask the user for input.

101

Python VirtualEnv

A virtual environment in Python is an isolated environment on your computer, where you can run and test your Python projects.

Machine Learning

23 of 23 topics published
129

Getting Started

Machine Learning is making the computer learn from studying data and statistics.

130

Mean Median Mode

What can we learn from looking at a group of numbers?

131

Standard Deviation

Standard deviation is a number that describes how spread out the values are.

132

Percentile

Percentiles are used in statistics to give you a number that describes the value that a given percent of the values are lower than.

133

Data Distribution

Earlier in this tutorial we have worked with very small amounts of data in our examples, just to understand the different concepts.

134

Normal Data Distribution

In the previous chapter we learned how to create a completely random array, of a given size, and between two given values.

135

Scatter Plot

A scatter plot is a diagram where each value in the data set is represented by a dot.

136

Linear Regression

The term regression is used when you try to find the relationship between variables.

137

Polynomial Regression

If your data points clearly will not fit a linear regression (a straight line through all data points), it might be ideal for polynomial regression.

138

Multiple Regression

Multiple regression is like linear regression, but with more than one independent value, meaning that we try to predict a value based on two or more variables.

139

Scale

When your data has different values, and even different measurement units, it can be difficult to compare them. What is kilograms compared to meters? Or altitud

140

Train/Test

In Machine Learning we create models to predict the outcome of certain events, like in the previous chapter where we predicted the CO2 emission of a car when we

141

Decision Tree

! image (https://www.w3schools.com/python/img_ml_decision_tree.png)

142

Confusion Matrix

It is a table that is used in classification problems to assess where errors in the model were made.

143

Hierarchical Clustering

Hierarchical clustering is an unsupervised learning method for clustering data points. The algorithm builds clusters by measuring the dissimilarities between da

144

Logistic Regression

Logistic regression aims to solve classification problems. It does this by predicting categorical outcomes, unlike linear regression that predicts a continuous

145

Grid Search

The majority of machine learning models contain parameters that can be adjusted to vary how the model learns. For example, the logistic regression model, from

146

Categorical Data

When your data has categories represented by strings, it will be difficult to use them to train machine learning models which often only accepts numeric data.

147

K-means

K-means is an unsupervised learning method for clustering data points. The algorithm iteratively divides data points into K clusters by minimizing the variance

148

Bootstrap Aggregation

Methods such as Decision Trees, can be prone to overfitting on the training set which can lead to wrong predictions on new data.

149

Cross Validation

When adjusting models we are aiming to increase overall model performance on unseen data. Hyperparameter tuning can lead to much better performance on test sets

150

AUC - ROC Curve

In classification, there are many different evaluation metrics. The most popular is accuracy, which measures how often the model is correct. This is a great met

151

K-nearest neighbors

KNN is a simple, supervised machine learning (ML) algorithm that can be used for classification or regression tasks - and is also frequently used in missing val

Python DSA

20 of 20 topics published
152

Python DSA

Data Structures is about how data can be stored in different structures.

153

Lists and Arrays

In Python, lists are the built-in data structure that serves as a dynamic array.

154

Stacks

A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle.

155

Queues

A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle.

156

Linked Lists

A Linked List is, as the word implies, a list where the nodes are linked together. Each node contains data and a pointer. The way they are linked together is th

157

Hash Tables

A Hash Table is a data structure designed to be fast to work with.

158

Trees

A tree is a hierarchical data structure consisting of nodes connected by edges.

159

Binary Trees

A tree is a hierarchical data structure consisting of nodes connected by edges.

160

Binary Search Trees

A Binary Search Tree is a Binary Tree where every node's left child has a lower value, and every node's right child has a higher value.

161

AVL Trees

The AVL Tree is a type of Binary Search Tree named after two Soviet inventors Georgy Adelson-Velsky and Evgenii Landis who invented the AVL Tree in 1962.

162

Graphs

A Graph is a non-linear data structure that consists of vertices (nodes) and edges.

163

Linear Search

Linear search (or sequential search) is the simplest search algorithm. It checks each element one by one.

164

Binary Search

The Binary Search algorithm searches through a sorted array and returns the index of the value it searches for.

165

Bubble Sort

Bubble Sort is an algorithm that sorts an array from the lowest value to the highest value.

166

Selection Sort

The Selection Sort algorithm finds the lowest value in an array and moves it to the front of the array.

167

Insertion Sort

The Insertion Sort algorithm uses one part of the array to hold the sorted values, and the other part of the array to hold values that are not sorted yet.

168

Quick Sort

As the name suggests, Quicksort is one of the fastest sorting algorithms.

169

Counting Sort

The Counting Sort algorithm sorts an array by counting the number of times each value occurs.

170

Radix Sort

The Radix Sort algorithm sorts an array by individual digits, starting with the least significant digit (the rightmost one).

171

Merge Sort

The Merge Sort algorithm is a divide-and-conquer algorithm that sorts an array by first breaking it down into smaller arrays, and then building the array back t

Ready to go from notes to a real career?

Join CodingNow 2.0's Python course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.

Enroll Now — Free Demo Available

Python Notes – FAQs

What students search before reading Python notes.

Yes — all 194 Python topics on CodingNow 2.0 are completely free with no signup or paywall. Read them in the browser on mobile or desktop.
This hub covers 194 structured Python topics — from absolute basics to advanced, interview-ready concepts — each with short explanations and working code examples.
The notes are written to be self-study friendly, but for job-ready skills, projects and placement support, CodingNow 2.0's mentor-led Python course in Delhi (online + classroom) is the fastest path.
Yes. Each topic is concise and example-driven — ideal for last-minute revision before college exams, campus placements and Python job interviews in India.
Working AI/ML engineers and full-stack developers from CodingNow 2.0 – Gurukul of AI, Pitampura Delhi, aligned with our 2026 course curriculum.
WhatsApp
Call NowEnroll Now