#functions
Explore materials tagged "functions" from expert practitioners. Up-to-date articles and useful tips to help you grow.
Articles with tag "#functions"
All materials on the topic functions
How Functions Work Together in Python π§©
A small function normally handles one clear task. A real program, however, contains several tasks: receive data, process it, display...
map() β Transform Every Element!
The map() function lazily applies a transformation to every item in an iterable.
filter() β Pick What You Need!
The filter() function keeps the elements for which a predicate returns a truthy value.
Lambda Functions
A lambda is a small, anonymous, single-line function.
reduce() β Fold Everything into One!
The reduce() function combines an iterable into one value by repeatedly applying a two-argument function.
Pure Functions
A pure function depends only on its arguments, does not modify external state, and returns the same result for the...
Function Composition
Function composition connects small functions so that one function's result becomes the next function's argument.
Functions: Best Practices
Goal: Write functions that are easy to read, test, and reuse.
Functions in Python
Problem: you wrote a discount calculation β needed in 10 places, so you copy it 10 times. You find a...
Similar tags
Study related topics
Looking for more on the topic?
Study all our materials or subscribe to updates