Analyze nested composition and call timing

A score-processing library constructs new functions using the Python code below. Select every true statement about the resulting functions and their evaluation.


Python
def compose(first, second):
    def combined(x):
        return second(first(x))
    return combined

def increase(x):
    return x + 3

def square(x):
    return x * x

forward = compose(increase, square)
reverse = compose(square, increase)
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Higher-Order Functions Questions: