?
What will be the output of the following Python function?
What will be the output of the following Python function?
all([2,4,0,6])
all([2,4,0,6])
Answer & Solution
Correct Answer:
Option
C
The correct answer is Option C: False.
The
The
all() function in Python returns True if all elements of the iterable are true, and False otherwise. In this case, the iterable is [2,4,0,6][2,4,0,6]. Since the element 0 evaluates to False in a Boolean context, the function will return False. Therefore, the output of the function call all([2, 4, 0, 6]) will be False.
Join the Discussion
Login to post a comment or share your explanation.
Login