Skip to main content
HomePython

Course

Writing Functions in Python

Intermediate
4.7+
649 reviews
Updated 05/2025
Learn to use best practices to write maintainable, reusable, complex functions with good documentation.
Start Course for Free

Included withPremium or Teams

PythonProgramming4 hours15 videos46 Exercises3,650 XP97,386Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies

Course Description

You've done your analysis, built your report, and trained a model. What's next? Well, if you want to deploy your model into production, your code will need to be more reliable than exploratory scripts in a Jupyter notebook. Writing Functions in Python will give you a strong foundation in writing complex and beautiful functions so that you can contribute research and engineering skills to your team. You'll learn useful tricks, like how to write context managers and decorators. You'll also learn best practices around how to write maintainable reusable functions with good documentation. They say that people who can do good research and write high-quality code are unicorns. Take this course and discover the magic!

Prerequisites

Python Toolbox
1

Best Practices

Start Chapter
2

Context Managers

Start Chapter
3

Decorators

Start Chapter
4

More on Decorators

Start Chapter
Writing Functions in Python
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review

Included withPremium or Teams

Enroll now

Don’t just take our word for it

*4.7
from 649 reviews
81%
17%
2%
0%
0%
  • Swastik
    about 12 hours

  • Luisa
    about 14 hours

  • Somwut
    about 15 hours

  • Cyril
    about 20 hours

  • kittapad
    1 day

  • Endurance
    about 19 hours

Swastik

Luisa

Somwut

Join over 16 million learners and start Writing Functions in Python today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.