Python Basics: Functions and Loops

Functions are the building blocks of almost every Python program. They’re where the real action takes place!

In your Python Basics journey, you’ve probably encountered functions such as print(), len(), and round(). These are all built-in functions because they come built into the Python language itself. You can also create user-defined functions that perform specific tasks.

Functions break code into smaller chunks and are great for defining actions that a program will execute several times throughout your code. Instead of writing the same code each time the program needs to perform the same task, just call the function!

But sometimes you do need to repeat some code several times in a row. This is where loops come in.

In this Python Basics video course, you’ll learn:

  • How to create user-defined functions
  • How to write for and while loops

This video course is part of the Python Basics series, which accompanies Python Basics: A Practical Introduction to Python 3. You can also check out the other Python Basics courses.

Note that you’ll be using IDLE to interact with Python throughout this course.

What’s Included:

Downloadable Resources:

Related Learning Paths:

About Philipp Acsany

Philipp Acsany Philipp Acsany

Philipp is a Berlin-based software engineer with a graphic design background and a passion for full-stack web development.

» More about Philipp

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

« Browse All Courses