First-class functions
Functions treated as values enabling passing to other functions, returning from functions, and storing in variables. First-class functions enable functional programming.
Real World
In Python, the built-in sorted() function accepts a 'key' parameter — passing key=len sorts a list of strings by length, treating the len function as a first-class value.
Exam Focus
Show three capabilities — assigning to a variable, passing as an argument, returning from a function — to fully demonstrate first-class status.
How well did you know this?