Design Automation Department

Language:

Functional Programming in Python

Volodymyr Obrizan, PhD candidate at the APOT department, has translated the tutorial “Functional Programming in Python” by Andrew M. Kuchling into Ukrainian and enhanced it with interactive code examples and knowledge-check tests.

Functional Programming in Python

What is functional programming?

Functional programming (FP) is a programming paradigm where computation is treated as the evaluation of mathematical functions rather than changes in state or execution of sequences of commands. At the core of FP are pure functions, absence of side effects, and data immutability. This approach helps create code that is clear, predictable, and easy to test.

The tutorial covers the following topics:

  • What is functional programming?
  • Iterators
  • Generator expressions and list comprehensions
  • Generators
  • Built-in functions
  • The itertools module
  • The functools module
  • Small functions and lambda expressions

After completing the tutorial, students will understand:

  • The core principles of functional programming: pure functions, no side effects, composition
  • How to use map(), filter(), and reduce() in real-world problems
  • The concept and practical use of lambda functions in Python
  • The capabilities of the itertools and functools libraries for sequence processing and code optimization
  • How to write declarative, compact, and readable functional-style code
  • The advantages and limitations of the functional approach in Python

This tutor directly contributes to Sustainable Development Goal 4 (SDG 4), which aims to ensure inclusive and equitable quality education and promote lifelong learning opportunities for all.