Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.17K Points
Coach

Q.) If b is a dictionary, what does any(b) do?

(A) returns true if any key of the dictionary is true
(B) returns false if dictionary is empty
(C) returns true if all keys of the dictionary are true
(D) method any() doesn’t exist for dictionary
Correct answer : Option (A) - returns true if any key of the dictionary is true

Explanation:
 method any() returns true if any key of the dictionary is true and false if the dictionary is empty.

Share

Discusssion

Login to discuss.