# InfyTQ Functions (Python) Quiz 2

Question 1

Time: 00:00:00
At runtime the creation of anonymous functions in python, using a construct called __________

lambda

lambda

pi

pi

anonymous

anonymous

none of the mentioned

none of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 2

Time: 00:00:00
Lambda is a statement in Python programming?

Yes

Yes

No

No

Cannot say

Cannot say

May be

May be

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 3

Time: 00:00:00
```def prepinsta(i, j, k):
print(i + j + k)
prepinsta(2, 35, 403)```

Error

Error

405

405

440

440

442

442

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 4

Time: 00:00:00

```arr = [0, 1, 2]
return c+1

1 2 3

1 2 3

0 1 2

0 1 2

Error

Error

4

4

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 5

Time: 00:00:00
From the given statements which one is false about recursion?

A recursive function can be replaced by a non-recursive function

A recursive function can be replaced by a non-recursive function

Recursive functions usually take more memory space than non-recursive function

Recursive functions usually take more memory space than non-recursive function

Recursive functions run faster than non-recursive function

Recursive functions run faster than non-recursive function

Recursion makes programs easier to understand

Recursion makes programs easier to understand

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 6

Time: 00:00:00
```def test(x,y):
if(x==0):
return y
else:
return test(x-1,x+y)
print(test(4,7))```

13

13

7

7

Infinite loop

Infinite loop

17

17

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 7

Time: 00:00:00
Tail recursion is?

A recursive function that has two base cases

A recursive function that has two base cases

A function where the recursive functions lead to an infinite loop

A function where the recursive functions lead to an infinite loop

A recursive function where the function doesn’t return anything and just prints the values

A recursive function where the function doesn’t return anything and just prints the values

A function where the recursive call is the last thing executed by the function

A function where the recursive call is the last thing executed by the function

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 8

Time: 00:00:00

```def prep(name, val):
print(name(val), end=" ")
prep(max, [1, 2, 3])
prep(min, [1, 2, 3])```

1 2 3

1 2 3

1 1 2 2 3 3

1 1 2 2 3 3

3 1

3 1

Error

Error

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 9

Time: 00:00:00

```def prep(z):
z = ['def', 'abc']
return id(z)
q = ['abc', 'def']
print(id(q) == prep(q))```

True

True

False

False

none

none

error

error

Once you attempt the question then PrepInsta explanation will be displayed.

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%