import numpy as np a = list() a.append(list(np.arange(4))) a.append(list(np.arange(5, 7))) b = str(a) b = b.replace('[', '') b = b.replace(']', '') a = list(eval(b)) print(a)