A Professional’s Tutorial to Simple Python Functions
Functional programming, Python terms and concepts
Welcome to the sixth, in a series of tutorials that teach beginner Python specifically for aspiring data scientists. For an overview of these tutorials, click here.
Introduction
The vibrant world of data science with its vast set of algorithms, tools, and statistical techniques, relies on the elegance of Python’s simplicity.
Some feel however that Python’s charm is deceptive — behind the façade of its straightforward (readable) syntax lies an engine that powers complex analyses. There are layers and layers of complexity. In this tutorial we peel another layer for a look at functions.
At, or very nearly at, the heart of Python functions is the def
statement. This statement is the syntax that defines a function. This unassuming three-letter word unlocks much of Python's potential, allowing you to encapsulate logic, streamline repetitive tasks, and breathe life into your code.
Through this tutorial on Python functions, you'll discover how this foundational tool can not only…