I have a list that is to be divided into two parts then, each part have to be written into different lists. The code which i tried is here and it works fine.
import sys
a = ['name','2',3,4,5,'a','b','c','d',10,4,'lol','3']
print len(a)
list1 =[]
list2 = []
for i in xrange(0, (len(a)/2)):
list1.append(a[i])
list2.append(a[(i)+((len(a)/2))])
list2.append(a[(len(a))-1])
print list1
print list2
I would like to know if there is any other better alternative way to do this..