Python — From Basics to Advanced · Functions and Modules
Defining Functions
Functions and Modules
Introduction
A function is a named block of code you can call from many places. It removes repetition and gives chunks of logic a meaningful name. In this lesson you meet the def keyword, the return statement, parameters and a few conventions that make your code look professional from day one.