s = "[[11,2],[2,31,2],[1]]"
res = []; num = 0
for i in s[1:- 1]:
if i=="[":
tmp = []; flag = True
elif i =="]":
flag = False
tmp.append(num); res.append(tmp) #①
elif i==",":
if :tmp.append(num)
num = 0
else:
num = num*10+int(i)
print(res)
关于上述代码,下列说法正确的是( )