Python-Quizzes | Python Dictionary Quiz | Question 8

Question 8:Find the output of the following program:

filter_none

edit
close

play_arrow

link
brightness_4
code

dict ={} 
print (all(dict)) 

chevron_right


(A) { }
(B) False
(C) True
(D) An exception is thrown


Answer: (C)

Explanation: The all() method returns:

  • True – If all elements in an iterable are true ot iterable is empty.
  • False – If any element in an iterable is false.


Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.