• Python question of the day

    Which of the following code snippets, when executed, would print True
     s1 = {}; print(all(s1))
     s1 = {0}; print(all(s1))
     s1 = {not(0)+1}; print(all(s1))
     s1 = {False+True, False*True}; print(all(s1))
    Explanation:
    The all() function returns True if all items in an iterable are true or if the iterable object is empty.


    Top 100 python interview questions:






datai analytics