Python Functions
Python Functions - Important Points
11. | What is the output of the following code? |
---|
A. [1, 4, 9, 16, 25]
B. [1, 2, 3, 4, 5]
C. [2, 4, 6, 8, 10]
D. [3, 6, 9, 12, 15]
View Answer Discuss Work SpaceAnswer: option a
Explanation:
12. | What is the purpose of the filter function in Python? |
---|
A. It applies a function to each element of an iterable and returns a new iterable
B. It filters an iterable based on a given function
C. It converts an iterable to a dictionary
D. It sorts an iterable based on a given function
View Answer Discuss Work SpaceAnswer: option b
Explanation:
13. | What is the output of the following code? |
---|
A. [1, 3, 5]
B. [2, 4]
C. [1, 2, 3, 4, 5]
D. []
View Answer Discuss Work SpaceAnswer: option b
Explanation:
14. | What is the output of the following code? |
---|
A. 3
B. 6
C. 10
D. 5
View Answer Discuss Work SpaceAnswer: option c
Explanation:
15. | What is the output of the following code? |
---|
A. 1
B. 4
C. 10
D. 3
View Answer Discuss Work SpaceAnswer: option c
Explanation: