Python生成器与迭代器的总结
列表生成式举个例子,要生成list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]可以用list(range(1, 11)):>>> list(range(1, 11)) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]但如果要生成[1x1, 2x2...
Free Open Share