have below list
a = [1,2,3,4,5,6,7,8,9,10]
and want to convert to below:
b = [[1,2],[3,4],[5,6],[7,8],[9,10]]
tried below but result not true
b = [i for i in a[::2]]
how can do it and what is shortest way?
have below list
a = [1,2,3,4,5,6,7,8,9,10]
and want to convert to below:
b = [[1,2],[3,4],[5,6],[7,8],[9,10]]
tried below but result not true
b = [i for i in a[::2]]
how can do it and what is shortest way?