
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Introduction to the course, and explanation of how to navigate the following sections.
Let's take a brief look at the different 'styles' of programming, formally known as paradigms.
Imperative programming is the most common paradigm, where data changes state using control flow, loops and more etc.. In this session we take a look at some basic examples.
Declarative programs focus on what the data should look like, and not how to achieve it. In this session we take a look at this slightly tricky concept!
In this session we introduce the Action, Source, Condition model, which is a key component in understanding comprehensions.
In this session we'll take a look at converting some traditional imperative code in to its declarative counterpart.
Let's write your first list comprehension! The concepts taught here will persist across the rest of the course.
Taking the previous session a step further, we will write our own functions and use these as the action in our comprehension.
It's time to bring in a simple condition to our list comprehension to apply some simple filtering.
Let's take our conditions a step further and make our conditions more complex.
Just like how we can use a custom function for our action, we can do the same for our condition.
Did you know this operator existed? In this session we'll look at how to implement this rather fascinating piece of Syntax.
We can also add an else clause as part of the 'action' to our list comprehensions, this is for more advanced use cases and can be really useful!
Comprehensions are great! But.. there are places where can use alternatives, and we'll explore them in this session.
In this session we will use what we have covered so far to cover some real-life use cases.
In our first stop and code session you will be asked to solve 3 list comprehension challenges.
Sets behave a bit differently to lists, so we'll briefly discuss the differences before we continue.
The set comprehension is written almost identically to a list comprehension, and in this session we'll touch on the differences.
In the second stop and code session you will be asked to solve 3 set comprehension challenges.
Generators can save unnecessary computation, using 'lazy evaluation' meaning that items are only computed when they are required. In this session we discuss the benefits.
Generators 'yield' items, so we need to use the next() function to ask for items to be computed and returned. In this section we explore and experiment with this concept.
In the third stop and code session you will be asked to solve 3 generator comprehension challenges.
Dictionary comprehensions are arguably more complex as we can use the action, source condition model over both the keys and values of a dictionary. We'll explore the basics in this session with some easy examples.
In this practical session we will apply a range of functions to the keys & values in our dictionary comprehension.
In this practical session we will apply a range of functions to the keys & values in our dictionary comprehension.
Nested comprehensions are fairly difficult to read at first, and in this example we'll unpack a couple of easier examples.
In this practical session we'll carefully pull apart and analyse some fairly complex nested comprehensions, to understand their inner workings.
In our final stop and code session we'll cover 2 questions with an in-depth look at the solutions.
Welcome to Functional Programming with Python Comprehensions!
This course is carefully crafted to bridge the gap between beginner and intermediate Python programming, focusing specifically on functional programming principles. Throughout the course, you'll embark on a transformative journey, mastering the art of using list, set, dictionary, and nested comprehensions to write clearer, concise, and more efficient code.
At the end of this course you can expect to have a real understanding of:
List Comprehensions.
Set Comprehensions.
Dictionary Comprehensions.
Generator Comprehensions.
Nested Comprehensions.
The difference between Imperative & Declarative Programming styles.
Each section is supplemented with quizzes and coding exercises that allow you to practice and solidify your understanding of the material. These exercises are designed to mirror real-world scenarios and job interview scenarios, enabling you to develop problem-solving skills while applying functional programming concepts.
Additionally, this course offers a unique feature—a monthly job interview style question. Each month, you'll be presented with a challenging question designed to test your understanding of functional programming concepts and your ability to apply them in a practical setting. These exercises will not only help you gauge your progress but also prepare you for real-world coding interviews.
By the end of this course, you'll have mastered the art of functional programming with Python comprehensions. You'll possess a deep understanding of the benefits and applications of functional programming, allowing you to write cleaner, more concise, and highly efficient code. Whether you aim to enhance your career prospects, tackle complex coding challenges, or simply expand your programming skill set, this course equips you with the knowledge and confidence to excel.
Enroll now and embark on a transformative journey into the realm of functional programming with Python comprehensions. Let's unlock the power of functional programming together and take your Python programming skills to new heights!