A Professional’s Tutorial to Simple Python Functions

Functional programming, Python terms and concepts

Adam Ross Nelson

--

For an overview of these tutorials, click here (or click the image).

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.

A pencil that has drawn a sin-like function on an x and y coordinate system.
Image Credit: Author’s illustration created in Canva.com.

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…

--

--

Adam Ross Nelson

Ask about my free career course. I mentor new (💫) and aspiring data scientists enter (🚪) and level up (📈) in the field.