I want to split the following list into sub lists based on an element from that list.
array=['first','sentence','step','second','sentence']
for i in array:
if i!='step':
newlist1.append(i)
else:
(stop appending in newlist1 and start appending in say newlist2)
newlist1 and newlist2 can not be pre declared. As the number of elements in the array can vary. SO I need to find a dynamic way of declaring lists as per the requirement.