Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Returning a Multiplier Function | Variable Scope, Nested Functions, and Closures
Functional Programming Concepts in Python
Section 3. Chapter 6
single

single

bookChallenge: Returning a Multiplier Function

Swipe to show menu

Task

Swipe to start coding

Write a function that returns another function which multiplies its argument by a fixed number.

  • Call the nested function multiplier.
  • The returned function must multiply its input by the value of n.
  • The outer function must return the inner function.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt