python lambda practice

Solutions on MaxInterview for python lambda practice by the best coders in the world

showing results for - "python lambda practice"
Jakob
17 May 2016
1def mul_by_num(num):
2    """
3    Returns a function that takes one argument and returns num
4    times that argument.
5    >>> x = mul_by_num(5)
6    >>> y = mul_by_num(2)
7    >>> x(3)
8    15
9    >>> y(-4)
10    -8
11    """
12    "*** YOUR CODE HERE ***"
13    return ______
14    return lambda num2: num * num2