['1899', 'Horsey', '1909', 'Ford', '1911', 'Overland',]
For example, I want to convert the above list into this form:
['1899', 'Horsey']['1909', 'Ford']['1911', 'Overland']
How can I do that? I'm very new to python.
['1899', 'Horsey', '1909', 'Ford', '1911', 'Overland',]
For example, I want to convert the above list into this form:
['1899', 'Horsey']['1909', 'Ford']['1911', 'Overland']
How can I do that? I'm very new to python.
You can use list comprehension in python
Origlist = ['1899', 'Horsey', '1909', 'Ford', '1911', 'Overland',]
sublistsize = 2
sublists = [Origlist [x:x+sublistsize] for x in range(0,len(Origlist ),sublistsize)]