for i in range without i 1

for i in range without i

def loop(f,n):
    for i in xrange(n): f()

loop(lambda: , 5)

Here is what the above code is Doing:
1. The function loop is defined. It takes two arguments: f and n.
2. The function loop calls the function f n times.
3. The function loop is called with two arguments: a lambda expression and the number 5.
4. The lambda expression is called 5 times.
5. The lambda expression prints the string “I’m learning about higher order functions!”

Similar Posts