Nested functions

Report a typo

Define a function that takes a number n and returns a function that, in its turn, takes x as an argument and returns the remainder of the division of x by n.

You don't have to handle input or print anything, just implement the function.

In create_function(n), return a lambda function with the argument x that calculates x % n.

Sample Input 1:

2
10

Sample Output 1:

0
Write a program in Python 3
def create_function(n):
return ...
___

Create a free account to access the full topic