I do get the solution but still it says that the code is wrong and doesn't give the desired output


def main():
my_list = [[‘a’, ‘b’], [‘cc’, ‘dd’, [‘eee’, ‘fff’]], [‘g’, ‘h’]]

# insert a new list [1, 2, 3] at the end of my_list
my_list.extend([1,2,3])# Your code goes here


# Delete 'eee' from the list
my_list[1][2].pop(0)# Your code goes here

return 0

if name == ‘main’:




simply use append instead of extend. my_list.append([1, 2, 3])
otherwise my_list.extend([[1, 2, 3]])

As append adds an element to the end of the list, but extend extends the current list to include the elements from the new list. Read the Description above for more details.