1.

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 dictionaryThe question was asked in an interview.My query is from Dictionary in chapter Dictionary, Functions and Built-in Functions of Python

Answer» RIGHT choice is (a) Returns True if any KEY of the dictionary is true

The EXPLANATION is: Method any() returns True if any key of the dictionary is true and FALSE if the dictionary is empty.


Discussion

No Comment Found

Related InterviewSolutions