+ 1
insert
my_list=[(1,2,3,4) , (100,200,300)] I want to insert 400 to the first index of my_list (i mean (100,200,300) but i don't know how !help please
1 Respuesta
+ 1
You can use insert method. But in your list you have tuples which are immutable. If replace them to lists you can insert any data.
my_list=[(1,2,3,4),[100,200,300]]
my_list[1].insert(3,400)
Other way:
my_list[1].append(400)