lis = [2, 3, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"],用python方法在 “qwe”前面插入字符串:”火车头”
时间: 2023-09-24 22:10:32 浏览: 87
LIS2DH12TR,LIS3DH应用笔记
可以使用以下代码进行操作:
lis = [2, 3, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"]
lis[3][0] = "火车头" + lis[3][0]
print(lis)
输出结果为:
[2, 3, 'k', ['火车头qwe', 20, ['k1', ['tt', 3, '1']], 89], 'ab', 'adv']
阅读全文