import json
ll = ['1','2','3','L某人']
st = str(ll)
# lists=list(st)
# 将字符之前的逗号去掉,并拼接字符
a=''.join(st.split(","))
print('a:',type(a))
print('a:',a)
# eval将z字符之前的引号去掉
s=eval(a)
print('s:',type(s))
print('s:',s)
输出结果为:
import json
ll = ['1','2','3','L某人']
st = str(ll)
# lists=list(st)
# 将字符之前的逗号去掉,并拼接字符
a=''.join(st.split(","))
print('a:',type(a))
print('a:',a)
# eval将z字符之前的引号去掉
s=eval(a)
print('s:',type(s))
print('s:',s)
输出结果为: