ExamVeda
Login
Home
Python Built In Functions
?

What will be the output of the following Python function?
all([2,4,0,6])

Answer & Solution
Correct Answer: Option C
The correct answer is Option C: False.
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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.