• Python question of the day

    Which of the following statements, when executed, raises the TypeError?
     my_set = set(( ))
     my_set = {1, 2, [3, 4]}
     my_set = set([1, 'a', (3, 4)])
     my_set = {1, "Hello", (2, 'Hi'), None}
    Explanation:
    In python, a set cannot have mutable objects as its members and list is a mutable object


    Top 100 python interview questions:


  • python bootcamp 2021
datai analytics