a = [1,2,3] b = [1,2,3] c = [q * r表示q,r表示拉链(a) ,b)] 似乎对我有用。 -tima = [1,2,3]b = [1,2,3]c = [q*r for q,r in zip(a,b)]seems to do the trick for me.-tim" Diez B. Roggisch" <德*** @ nospam.web.de>在消息中写道 新闻:4b ************* @ uni-berlin.de ..."Diez B. Roggisch" <de***@nospam.web.de> wrote in messagenews:4b*************@uni-berlin.de...它被认为是坏的如果你想要的只是一个索引的枚举,因为它实际上会创建一个你指定的大小的列表。在这种情况下使用xrange。 it''s considered bad style to use range if all you want is a enumeration of indices, as it will actually create a list of the size you specified. Use xrange in such cases. 我很确定这种区别在2.5中消失了。 干杯, Alan IsaacI''m pretty sure this distinction goes away in 2.5.Cheers,Alan Isaac 这篇关于名单*名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-12 12:29