Skip to main content
HomePython

Free course

Introduction to Functions in Python

Beginner
4.6+
178 reviews
Updated 02/2025
Learn the art of writing your own functions in Python, as well as key concepts like scoping and error handling.
Start Free Course

Included for Free

PythonProgramming3 hours10 videos44 exercises3,550 XP434,578Statement 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

It's time to push forward and develop your Python chops even further. Python has tons of fantastic functions and a module ecosystem. However, as a data professional or developer, you'll constantly need to write your own functions to solve problems that are dictated by your data. You will learn the art of function writing in this first course. You'll come out of this course being able to write your very own custom functions, complete with multiple parameters and multiple return values, along with default arguments and variable-length arguments. You'll gain insight into scoping in Python, be able to write lambda functions and handle errors in your function writing practice. You'll wrap up each chapter by using your new skills to write functions that analyze Twitter data.

Prerequisites

Intermediate Python
1

Writing your own functions

Start Chapter
2

Default arguments, variable-length arguments and scope

Start Chapter
3

Lambda functions and error-handling

Start Chapter
Introduction to 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.6
from 178 reviews
76%
12%
8%
3%
1%
  • Hal E.
    27 days

    This was a good overview of functions. It was a good collection of habituation exercises. My only quibble would be the exercises were a bit contrived over the same concept of printing and concanetating the same strings.

  • Zarina T.
    about 1 month

    I really like the environment they built to run the code, and they provided hints and made it easier to run code and understand the programming language. Than you, Data Camp team

  • Nahimana D.
    about 2 months

    It was nice and organized.

  • Thuthukani N.
    3 months

    I would have liked more lambda examples. It is complex, but doable with examples.

  • Mihaela G.
    4 months

    Made the learning experience fun and insteresting. Clearly explained concepts, followed by practical examples to help reinforce them. All in all, a very good introductory course that motivates me to keep on learning.

"This was a good overview of functions. It was a good collection of habituation exercises. My only quibble would be the exercises were a bit contrived over the same concept of printing and concanetating the same strings."

Hal E.

"I really like the environment they built to run the code, and they provided hints and made it easier to run code and understand the programming language. Than you, Data Camp team"

Zarina T.

"It was nice and organized."

Nahimana D.

FAQs

Join over 16 million learners and start Introduction to 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.