Chaining Functions6:49 with Kenneth Love
Standalone functions are great but when we're writing small functions, we often need to do more work than we can achieve in a single function. Luckily, we can chain functions so long as we write them correctly.
sorted(), and friends all return iterables, we can chain them together. Chained functions resolve, or happen, from the inside out, so the innermost function runs first.
This is another reason why functions usually
return a value at the end. It makes it easier to use them all together.
True if any of the items in the iterable are truthy. Similar is the function
True if all of the items in the iterable are truthy.
Watch our comprehensions workshop if you want more information.
You need to sign up for Treehouse in order to download course files.Sign up