Lesson 22. Advanced operations with functions

After reading lesson 22, you’ll be able to

  • Pass functions (as an object) as a parameter to another function
  • Return a function (as an object) from another function
  • Understand which variables belong to which scope based on certain rules

Before formally learning about functions in lesson 21, you saw and used functions in simple code. Here are some of the functions you’ve been using already:

  • len()—For example, len("coffee")
  • range()—For example, range(4)
  • print()—For example, print("Witty message")
  • abs(),sum(),max(),min(),round(),pow()—For example, max(3,7,1)
  • str(),int(),float(),bool()—For example, int(4.5)
Consider this

For each of the following function calls, how many parameters does ...

Get Get Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.