O'Reilly logo
live online training icon Live Online training

Functional Programming with Python 3

Write More Robust, Readable Code

Shaun Wassell

Functional Programming is a revolutionary way of writing code and is rapidly gaining traction in the world of software development. While Object-Oriented Programming is still the most popular programming paradigm, there are a number of problems that come about when using it - hard-to-find bugs, tightly-coupled code, very difficult to scale. Functional programming allows us to solve or avoid all these problems by taking a very different approach to writing software. By learning and following the core concepts of Functional Programming, you can quickly write more maintainable, flexible, and beautiful code.

What you'll learn-and how you can apply it

  • The core concepts of Functional Programming and how to apply them in Python
  • First-class functions and what we can do with them
  • Python’s built-in list functions and how they help us work with data, including List Comprehensions
  • Advanced functional concepts such as currying, recursion, and composition

This training course is for you because...

  • You’re a software developer who’s tired of brittle code
  • You’ve heard about Functional Programming and want to see how to use it in Python
  • Your team members keep talking about Functional Programming and you want to be able to join in the conversation

Prerequisites

  • Knowledge of Python 3 syntax

Course Set-up

  • You’ll want to have the latest version of Python 3 installed

Recommended Preparation

Recommended Follow-up

About your instructor

  • Shaun is a lifelong programmer and problem-solving addict. His goal is to help people build incredible software and solve meaningful problems by mastering the art of software development. He currently works as a Senior React Developer, but also has a lot of side gigs, including consulting, freelance development, and online education. Don’t hesitate to get in contact with him if you enjoy his materials.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Overall Introduction (5 mins)

Learning the Basic Functional Concepts (40 mins)

  • Learning the Benefits of Functional Programming
  • Learning the Difference between Declarative and Imperative Code
  • Discovering The Three Core Concepts of Functional Programming
  • Learning About Immutability
  • Separating of Data and Functions
  • Working with First-Class Functions
  • Q&A

Working with First-Class Functions (60 mins)

  • Treating Functions as Data: Assigning Functions to Variables
  • Treating Functions as Data: Arrays of Functions
  • Passing Functions as Arguments
  • Returning Functions
  • Using Closure in Functional Programming
  • Using Higher-Order Functions
  • Q&A

Break (10 mins)

Working with Arrays and Objects (80 mins)

  • Working with Lists “Functionally”
  • Mapping
  • Filtering
  • Lambdas in Python
  • List Comprehensions
  • Reducing
  • Combining List Functions
  • Converting to List Comprehensions
  • Q&A

Break (10 mins)

Learning Advanced Functional Concepts (25 mins)

  • Learning Partial Application & Currying
  • Learning Recursion
  • Q&A

Course Wrap-up and Next Steps (10 mins)