I am trying to make a new list, which is a replica of an other list. This new list I want to modify by changing values at specific positions.
I found this question, and the most upvoted answer can make a new list and add on to the old list. This is a good start, but I want to decide where the additions are done (in his version, it just adds it on to the end of the list)
What he has:
myList = [10,20,30]
yourList = myList + [40]
print("your list: " + yourList)
your list: [10,20,30,40]
In this instance, I would want to be able to change where the 40 in your list goes ie
your list: [10,40,20,30]
I'm unsure how I would go about doing that. Thanks! (Pretty new here sorry if I'm not clear)