Browse Python Tutorials
Easy-to-follow tutorials packed with code examples and quizzes.
Python Basics
- Operators I
Arithmetic Operators in Python
In this lesson you will learn how to do mathematical operations using arithmetic operators in Python. - Operators I
Advanced Arithmetic Operators in Python
In this lesson you will learn about the floor division and the modulo operator in Python. - Operators I
Assignment Operators in Python
Learn about Assignment Operators in Python.
- Strings I
Introduction to Strings in Python
In this lesson you will learn how to work with text data in Python. You will create your first Python strings and attach one string with another. - Strings I
Introduction to String Indexes and Slicing
In this lesson you will how to extract specific parts of a string using indexes and string slicing. - Strings I
Introduction to String Methods
In this lesson, you will learn methods to locate and find specific sub_strings within a string and manipulate strings.
- Booleans
Introduction to Booleans and data types
In this lesson you will learn what Booleans are. We will also talk about data types and the built-in type function. - Booleans
Introduction to Comparison Operators
Learn how to compare different values with each other and understand how Booleans indicate the result of these comparisons. - Booleans
Introduction to Logical Operators
Discover how logical operators allow you to combine and evaluate boolean values, influencing the flow of your program based on the outcome of these logical conditions.
- Conditionals I
Introduction to Python Conditionals
In this lecture, you'll learn how to use Python conditional statements to make decisions and control the flow of your programs. - Conditionals I
Testing multiple conditions
In this lesson, we will build on our understanding of the if statement by introducing the elif and else statements to handle multiple conditions and create more complex decision-making logic in Python.
- Functions I
Introduction to Functions in Python
Functions are reusable blocks of code that perform specific tasks. In this lesson, you will learn how to define simple functions and how to use them. - Functions I
Introduction to function parameters in Python
Learn how to make your Python functions more flexible and powerful by using parameters to pass data.
- Lists and Tuples
Introduction to Lists in Python
Lists are ordered collections of items that can store elements of different data types. In this lesson, you will learn how to create lists, how to access elements within a list, and how to get some information about the contents of a list. - Lists and Tuples
Modifying Lists in Python
In this lesson, you will learn about various methods for updating lists and understand the concept of list mutability. - Lists and Tuples
Introduction to Tuples in Python
In this lesson, you will learn about tuples. You will understand their differences from lists, and explore typical use cases.
- Loops
Introduction to for-loops in Python
Learn the principles of for-loops in Python, understanding how to repeatedly execute a specific task and iterate over sequences of data. - Loops
Control Statements and Nested Loops
Learn how to control the flow of a loop using the break and continue statements. We will also explore the concept of nesting loops for more complex iterations. - Loops
Introduction to while-loops
In this lesson, you will get to know while-loops, the second type of loop in Python. While-loops continuously execute a block of code as long as a certain condition is true.
- Dictionaries
Introduction to Python Dictionaries
In this lesson, you will learn about dictionaries, a data structure in Python used to efficiently organize data with key-value pairs. You'll discover how to create dictionaries, as well as how to access and update stored data. - Dictionaries
Dictionary length, keyword in, and nested dictionaries
Learn how to use the `len` function and `in` keyword with dictionaries. Also, discover how to organize complex hierarchical data structures using nested dictionaries. - Dictionaries
Modifying Python Dictionaries
In this lesson, you will learn how to modify existing dictionaries by updating, adding, and deleting key-value pairs. - Dictionaries
Object views and iterating over dictionaries
In this Python lesson, you'll explore object views, dynamic representations of a dictionary's keys, values, or items, and learn how to use them to iterate over dictionaries.
Intermediate Python
- Strings II
Escape Characters
Learn how to use escape characters in Python to insert special characters like newlines, tabs, and quotes into strings. - Strings II
Python String split()
In this tutorial, we will explore the Python string methodstr.split()
which is used to split a string into multiple smaller strings. - Strings II
Introduction to f-strings
In this lesson, you’ll learn how to insert values, variables, or expressions directly into a string using f-strings. - Strings II
Formatting numeric values with f-strings
In this lesson, you will learn how you can format numeric values with f-strings.
- Unpacking
Assigning Multiple Variables with Unpacking
In this lesson, you'll learn how to assign multiple variables at once using unpacking. We'll demonstrate how you can extract values from various iterables like strings and lists and assign these values to multiple variables. - Unpacking
Ignoring Values While Unpacking and the * Operator
When unpacking values from an iterable, you might want to extract only certain values and ignore others or you might want to capture and combine a subset of the values. In this lesson, you'll learn to do so using the_
placeholder and the*
operator.
- Functions II
Introduction to Global and Local Scope
In this lesson, you'll learn about about the concept of global and local scopes, how to access and modify global variables inside a function, and how to use theglobal
keyword in Python. - Functions II
Introduction to Nested Functions
Learn how to create and correctly call nested/inner functions. - Functions II
Nested Functions and Enclosing Scope
Learn about the enclosing scope, which allows nested functions to access variables defined in their outer (enclosing) function. - Functions II
Introduction to Closures
Learn how to return functions from other functions and use this technique to create closures. Discover what closures are and how they can be used to create function factories and a kind of 'protected memory'.
- Working With Iterables
Aggregate and Analyze Iterables
This tutorial recaps what we've learned about Python iterables, such as strings and lists. We'll use built-in functions likemin()
,max()
, andsum()
to extract information from these iterables. - Working With Iterables
Introduction to list comprehension
This tutorial explores list comprehension in Python—a concise way to create lists from iterables. We’ll cover the basic syntax, usage, and show how list comprehension can often replace traditional for-loops.
- Functions III
Introduction to lambda functions
This tutorial explores lambda functions in Python, covering their syntax, usage, and advantages over traditional function definitions. - Functions III
Higher Order Functions and Map
In this tutorial, you'll learn about higher order functions in Python, including how to use them with lambda functions and the built-inmap
function. Discover how these concepts can simplify your code and make it more efficient.
Basic Data Analysis
- NumPy
Introduction to NumPy
In this lesson, we will discuss the NumPy library, its significance in Python data analysis, and how to create your first NumPy arrays. - NumPy
Introduction to multidimensional NumPy arrays
In this tutorial, you will learn how to use NumPy to work with multidimensional data structures. - NumPy
Updating NumPy array elements and Boolean Indexing
In this tutorial, you will learn how to change the values of NumPy array elements and to filter and conditionally update values using Boolean Indexing. - NumPy
Other ways to create NumPy arrays
In this tutorial, you will learn more methods for creating NumPy arrays.
- Matplotlib
Introduction to Matplotlib
In this lesson, we will create our first basic plots using the matplotlib library. - Matplotlib
Customizing line appearance
In this lesson, you will learn how to change the appearance of the plot lines. - Matplotlib
Customizing plot appearance
In this lesson, you will learn how to modify different aspects of your plot, such as adding a grid or customizing the ticks along the axes. - Matplotlib
Tutorial: Plotting Multiple Data Series on the Same Graph
In this lesson, you will learn how to represent different data series as lines on the same graph, allowing for easy comparison and analysis. - Matplotlib
Tutorial: Introduction to Scatter Plots
In this lesson, you will learn about a new type of graph: scatter plots. You will discover how to create these plots, understand their use cases, and see how they differ from line graphs.
- pandas
Introduction to pandas
In this lesson, we will talk about another important data science library: pandas. You will learn what this library is used for and make your first steps by importing and displaying data frames. - pandas
Filtering pandas data frames
In this lesson, you will learn how to filter rows of a pandas DataFrame based on specific conditions. - pandas
Descriptive statistics of pandas DataFrames
In this lesson, you will learn how to get helpful statistical information about pandas datasets, such as the mean, maximum, and standard deviation. This will help you better understand your data and facilitate further data analysis.