python 不规则列表降维

    tt = [1, 2, [3, 5, 4]]
    t = str(tt)
    t=t.replace('[', '')
    t=t.replace(']', '')
    t=list(eval(t))
    print(t, type(t))

猜你喜欢

转载自blog.csdn.net/weixin_40744265/article/details/89508538
今日推荐