1arr = '[[1, 2], [3, 4], [5, 6]]'
2num_set = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
3arr_list = list(arr)
4
5matrix = []
6row = []
7
8for i in range(0, len(arr_list)):
9 try:
10 if(len(row) == 2):
11 matrix.append(row)
12 row = []
13 if(int(arr_list[i]) in num_set):
14 row.append(int(arr_list[i]))
15 except:
16 continue
17
18print(matrix)