ExamVeda
Login
Home
Python Built In Functions
?

What is the output of the following code:
my_list = [True, False, True]
print(any(my_list))

Answer & Solution
Correct Answer: Option A
The any() function in Python returns True if at least one element of the iterable is true, otherwise it returns False.
In the provided code, the list [True, False, True] contains at least one True value, so the any() function returns True.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.