How can I insert an element at the first index of a list?
If I use list.insert(0, elem)
, does elem
modify the content of the first index?
Or do I have to create a new list with the first elem and then copy the old list inside this new one?
How can I insert an element at the first index of a list?
If I use list.insert(0, elem)
, does elem
modify the content of the first index?
Or do I have to create a new list with the first elem and then copy the old list inside this new one?