Functions: Advanced

While learning about Python for Data Science in our Python fundamentals course, you learned about functions, particularly in the Functions: Fundamentals and Functions: Intermediate lessons. But learning is a never-ending journey, and there's more to the world of Python functions! This Python Functions Advanced course will take you deeper into functional programming in Python and make you a functions master.

In this Python Functions Advanced course, you will build on your existing knowledge of functions to create better, faster-performing functions in your code.

Over the course, you'll learn how to make high quality functions by giving them docstrings and by making sure that they only do one thing. You will also learn how to make a function using the DRY principle, or "Don't Repeat Yourself," which helps you notice when you need to pull part of your code into a reusable function.

You will learn about how Python passes arguments to functions and the difference between mutable and immutable variables. And you'll dig deep into context managers, and how to write your own context managers using decorators.

By the end of this courser, you'll have a deep understanding of decorators: how they work, why they work, how to use them, and how to write decorators of your own. And you'll have built skills and experience with writing advanced Python functions using clean, highly-efficient code.

By the end of this course, you'll be able to:

  • Learn the best practices for writing functions in Python.
  • Learn how and when to use context managers.
  • Learn how to use and create your own decorators.

Learn by coding!

Get started today.

By creating an account you agree to accept our terms of use and privacy policy.

Learn Python Advanced Fucntion Concepts

Best Practices for Writing Functions

Learn the best practices for writing functions in Python.

Context Managers

Learn how to use and create context managers in Python.

Introduction to Decorators

Learn how to use decorators in Python and build the intuition needed to understand how they work.

Decorators: Advanced

Learn how to create your own decorators in Python.

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);