A function is a discrete section of code that performs a single, well-defined operation or a set of operations that share common logic. This tutorial will teach you the fundamentals of Python function definition. You will get an understanding of when and how to break up your code into user-defined functions.
You’ll also find out how to customise a function’s behaviour by passing in new parameters each time it’s called. In this lesson, you will discover:
work in Python and why they’re beneficial
define and call
your own Python function
to your function
Some differences between how to work with functions in
Python vs C++
from your function back to the calling environment
If you already have a firm grasp of Python’s most fundamental concepts—including data types, lists, dictionaries, the import statement, conditional expressions, and for loops—this course will be very beneficial.