• Python question of the day

    Which of the following code snippets, when executed would NOT give the following output:
    [1, 2, 3, []]
     w = [1,2,3]; w.add(len(w), []); print(w)
     w = [1,2,3]; w.insert(len(w), []); print(w)
     w = [1,2,3]; w.append([]); print(w)
     w = [1,2,3]; w.extend([[]]); print(w)
    Explanation:
    In python, list does not have add method


    Top 100 python interview questions:


  • python bootcamp 2021
datai analytics