I currently have a list (array) predefined and I am looking to add information into the array utilizing the split function. I want to keep the original items in the array. Here is my sample code:
mylist = []
for i in range(10):
a = 'array%i' %i
mylist.append(a)
szResult = "blah1 blah2 blah3 blah4"
mylist = szResult.split()
print mylist
When i print the output of the list it shows only the blah[1-4]. I was curious how to add this in with retaining it where mylist[4] would be array4
Use slice assignment: