randsemiconclusion = [3234234, 234234, 23432]
wordstring = " "
liststr = list(wordstring)
for i in range(0, len(randsemiconclusion)):
aw = randsemiconclusion[i]
for j in range(0, 6):
aac = int(i*7 + j+1)
liststr[aac] = aw[j]
wordstring = ''.join(liststr)
print("Wordstring --> ", wordstring, " <--")
回溯:
Traceback (most recent call last):
liststr[aac] = aw[j]
TypeError: 'int' object is not subscriptable
(这只是一个提取器-真正的代码)
我不知道为什么我会得到TypeError
此程序应提取列表中的数字,并将它们放在一个字符串中,如下所示:
list[12, 23, 32]
to:
122332
您可以重写如下函数:
相关问题 更多 >
编程相关推荐