嗨,我是一个初学者,我正试图总结一个列表,这是作为一个索引计数
下面的代码是为玩家分发卡片的代码
def component(self):
for card in range(2):
global componentcard
componentcard= listcard[card]
t = (re.findall('\d+', componentcard ))
x=list(t)
x = [i.split('\n')[0] for i in x]
print x[0],
输出给了我['1']['13'],如果我打印索引0,它会给我两个不同的卡值,但作为相同的索引0这给了我一个问题,添加相同的索引有什么想法吗?非常感谢
目前没有回答
相关问题 更多 >
编程相关推荐