Functional Programming
Learn how to use functional programming to create clean, efficient programs!
StartKey Concepts
Review core concepts you need to learn to master this subject
Functional Programming is Declarative Review
Declarative Programming Review Card
Functions Should Have no Side Effects
Using namedtuple
Lazy Iteration
Using Higher-order Functions Together
Working With Large Data Sets
Storing Data From CSV Files in a namedtuple
Functional Programming is Declarative Review
Functional Programming is Declarative Review
Functional programming is a programming paradigm that adheres to the declarative style of programming.
Functional Programming
Lesson 1 of 1
- 1Get ready to become a master of functional programming! This content branches off some content you may have run into from our Intermediate Python. We will do a quick review of: * tuples * lambda fu…
- 2Immutable data types are important to use in functional programming as they offer advantages, such as: * thread-safe data manipulation * preventing programmers from accidentally changing a value …
- 3Lambda functions are crucial in functional programming as they allow the production of neat and concise functions that require other functions as an argument. You should be familiar with lambda fun…
- 4In this exercise, we will review the map(), filter(), and reduce(), higher-order functions provided by Python. These functions accept an iterable and a processing function as arguments and return a…
- 5In this exercise, we will see how we can combine the map() and filter() functions. Conceptually, if you’re working with a collection of items and find yourself saying, “I need to map only values …
- 6In this exercise, we will explore how to use reduce() and filter() together. Let’s consider the following example. We have a tuple representing the menu items for a fictitious restaurant: The Codec…
- 7In this exercise, we will be focussing on the benefits of using reduce() and map() together. Consider the example of having a dictionary representing a cost of an item sale called costs which map…
- 8Now that you’ve learned how to combine any two functions, let’s see how (and why) we can combine all three! A reason for doing this would be when you need to “filter” a collection before you “map” …
- 9Functional programming is widely applicable in the data science domain as higher-order functions can be used to process data files efficiently. One of the most common formats for a data file is a C…
- 10In this exercise, we will see how we can process the data that is stored in a CSV file. When working with a file that contains a large amount of data, generating every possible record using tuple(…
- 11We may find ourselves in situations where we are working with JSON Data. The JSON format is the preferred way to structure data such that it may be transmitted over the internet. An API call usuall…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory