filmov
tv
Functional Programming in Python: Immutable Data Structures
![preview_player](https://i.ytimg.com/vi/xJCPpDlk9_w/maxresdefault.jpg)
Показать описание
In this Python tutorial you'll learn the basics of functional programming in Python and how you can use immutable data structures to represent data in your programs.
First, we'll go over what functional programming (FP) is from a computer science perspective and how it compares to other programming paradigms, like object-oriented programming (OOP), or procedural programming.
You'll learn how a functional programming style avoids side-effects and changing state in your programs by focusing on the application of mathematical functions as its core primitive.
Next, we'll take a simple data set and represent it inside our example program using immutable data structures (tuples and namedtuples from the "collections" module built into Python). Immutable data structures cannot be modified in-place and this can help reduce bugs.
This is part of a series of Python functional programming tutorials that I'm recording so stay tuned for the next instalment.
Also, be sure to check out these associated articles if you want to dive deeper into the subject:
* * *
FREE Python Coding Tutorials & News:
Комментарии