Python
Higher-Order Functions in Python
by Boot.dev Team - Programming course authors and video producers
In Python, functions are just values, like strings, integers, or objects. A programming language "supports first-class functions" when functions are treated like any other variable. That means functions can be passed as arguments to other functions, can be returned by other functions, and can be assigned to variables. Functions that accept other functions as arguments or return functions are called higher-order functions, and they power built-ins like map(), filter(), and reduce().
Closures in Python: How They Capture State
by Boot.dev Team - Programming course authors and video producers
A [closure]() is a function that references variables from outside its own function body. The function definition and its environment are bundled together into a single entity, so it keeps track of some values from the place where it was defined, no matter where it's executed later on.
Python Decorators: A Complete Guide With Code Examples
by Boot.dev Team - Programming course authors and video producers
Remember function transformations, where a higher-order function takes a function and returns a function with new behavior? Python decorators offer a kind of syntactic sugar around that. ("Syntactic sugar" just means "a more convenient syntax.") In this guide you'll learn what decorators are, how args and kwargs let them wrap any function, how to write decorators that take arguments, and how to use functools.lrucache for memoization.
Pure Functions in Python: A Complete Beginner Guide
by Boot.dev Team - Programming course authors and video producers
If you take nothing else away from this article, please take this: pure functions are fantastic. A pure function has exactly two properties: it always returns the same value given the same arguments (it's deterministic), and running it causes no [side effects](). In short: pure functions don't do anything with anything that exists outside of their scope.
Sum Types in Python: Using Enums, Unions, and Match
by Boot.dev Team - Programming course authors and video producers
Sum types are a staple of functional programming, but Python doesn't really support them. We have to use a workaround and invent our own little system and enforce it ourselves.
What Is Functional Programming in Python? A Complete Guide
by Boot.dev Team - Programming course authors and video producers
Functional programming is a style of programming where we compose functions instead of mutating state (updating the values of variables). While Python is best known for object-oriented programming, it also fully supports functional concepts like first-class functions, immutability, and pure functions. Learning to think functionally is one of the fastest ways to write cleaner, more maintainable code, no matter which language you end up working in.
Recursion in Python: A Beginner's Guide
by Boot.dev Team - Programming course authors and video producers
[Recursion]() is a famously tricky concept to grasp, but it's honestly quite simple, so don't let it intimidate you. A recursive function is just a function that calls itself.
Currying in Python: Transform Multi-Arg Functions
by Boot.dev Team - Programming course authors and video producers
Function currying is a specific kind of function transformation, where we translate a single function that accepts multiple arguments into multiple functions that each accept a single argument.
Function Transformations in Python: A Quick Guide
by Boot.dev Team - Programming course authors and video producers
"Function transformation" is just a concise way to describe a specific type of higher-order function. It's when a function takes a function (or functions) as input and returns a new function.
Python Inheritance: When to Use It and Skip It
by Lane Wagner - Boot.dev co-founder and backend engineer
Inheritance is one of those OOP tools that feels magical on day one and dangerous on day thirty. Used well, it removes duplication and keeps models clean. Used badly, it creates class trees no one wants to touch.
Python Classes and Objects: A Practical Beginner Guide
by Lane Wagner - Boot.dev co-founder and backend engineer
If classes and objects still feel slippery, you're not crazy. Most tutorials either go too abstract or drown you in weird examples. The practical way to learn OOP is simple: understand how data and behavior stick together, then build small objects that are easy to reason about.
Python Encapsulation vs Abstraction: What Matters
by Lane Wagner - Boot.dev co-founder and backend engineer
If classes and objects are the "what" of OOP, encapsulation and abstraction are the "how." They're how you keep code understandable after the project gets big, your team grows, and six months pass. They sound similar because they're close cousins, but they solve slightly different pains.
Python Polymorphism: One Interface, Many Behaviors
by Lane Wagner - Boot.dev co-founder and backend engineer
Polymorphism is where OOP starts to feel truly powerful. You stop writing giant if type == ... trees and start trusting shared interfaces. Different objects respond to the same method call in different ways, and your calling code stays clean.
Clean Code in Python: Write Readable, Maintainable Code
by Lane Wagner - Boot.dev co-founder and backend engineer
If you ask ten developers for a definition of clean code, you will get twelve answers and one argument in the comments. Still, most of us agree on the practical goal: write code that other humans can understand quickly and change safely. That matters way more than writing clever one-liners that only make sense to your past self at 2 AM.
Python Exceptions: Try, Except, and Raise
by Lane Wagner - Boot.dev co-founder and backend engineer
Python has two kinds of errors: syntax errors that prevent your code from running at all, and exceptions that happen while your code is executing. Knowing how to handle exceptions with try/except and how to raise your own is a core skill for writing reliable programs.
Python Sets: What They Are and How to Use Them
by Lane Wagner - Boot.dev co-founder and backend engineer
Sets are like lists, but with two key differences: they are unordered and they guarantee uniqueness. Only one of each value can exist in a set. If you need to track unique items or remove duplicates, sets are the tool for the job.
Python Dictionaries: How to Create and Use Them
by Lane Wagner - Boot.dev co-founder and backend engineer
Dictionaries are one of Python's most useful data structures. Instead of accessing values by a numeric index like you do with lists, you access them by a key — usually a string. If lists are like numbered shelves, dictionaries are like labeled drawers.
Python Lists: A Complete Beginner Guide
by Lane Wagner - Boot.dev co-founder and backend engineer
A natural way to organize and store data is in a list. Some languages call them "arrays", but in Python we just call them lists. Think of all the apps you use and how many of the items in them are organized into lists — a social media feed is a list of posts, an online store is a list of products, the state of a chess game is a list of moves.
Python Loops: For, While, Break, and Continue
by Lane Wagner - Boot.dev co-founder and backend engineer
Loops let you run the same code over and over without rewriting it each time. Whether you need to count through numbers, process items in a list, or keep going until a condition changes, Python gives you for loops and while loops to handle it.
Python If Statements: If, Else, and Elif
by Lane Wagner - Boot.dev co-founder and backend engineer
Every useful program needs to make decisions. Python's if statement is how you tell your code to do one thing or another depending on some condition — and once you understand if, elif, and else, you can handle just about any branching logic.
Python Math: Operators and Numbers Explained
by Lane Wagner - Boot.dev co-founder and backend engineer
Python has excellent built-in support for math operations — from basic arithmetic to exponents to bitwise logic. You don't need to import anything to do most math in Python, which is one reason it's so popular for everything from backend development to data science.
Python Functions: How to Define and Call Them
by Lane Wagner - Boot.dev co-founder and backend engineer
Functions allow you to reuse and organize code. Instead of copying and pasting the same logic everywhere, you define it once and call it whenever you need it. They're the most important tool for writing DRY code.
Python Variables: A Complete Beginner Guide
by Lane Wagner - Boot.dev co-founder and backend engineer
Variables are how we store data as our program runs. You're probably already familiar with printing data by passing it straight into print(), but variables let us save that data so we can reuse it and change it before printing it. This guide covers everything you need to know about Python variables: creating them, naming them, and understanding the basic data types they can hold. If you're just getting started, you might also want to know why Python is worth learning in the first place.
Queue Data Structure in Python: Ordering at Its Best
by Lane Wagner - Boot.dev co-founder and backend engineer
A queue is an efficient collection of ordered items. New items can be added to one side, and removed from the other side.
Understanding Stacks: Python Implementation of a Core Data Structure
by Lane Wagner - Boot.dev co-founder and backend engineer
A stack is an abstract data type that serves as a collection of elements. The name "stack" originates from the analogy of items physically stacked on top of each other. Just like a stack of plates at a buffet, plates can be added, removed, and viewed from the top. However, plates further down are not immediately accessible.
