python中去掉列表中的引号方法

例如:python中数据为['123,234,234']如何变成[123,234,234]

 

 

又如自己的小例子:
# 获取数据
ciphertext1 = input('待解密数据:')
print(ciphertext1)
a = [ciphertext1]
ciphertext = [int(i) for i in a[0].split(',')]
print(ciphertext)

 

posted @ 2021-07-29 15:40  Jaoany  阅读(8030)  评论(0编辑  收藏  举报