因为是PYTHON新手,这个问题竟然找了快一个小时。答案在这里:
http://stackoverflow.com/questions/3459098/create-list-of-single-item-repeated-n-times-in-python
输入:
['123'] * 5
输出:
['123', '123', '123', '123', '123']
版权声明:本文为bxprog原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
因为是PYTHON新手,这个问题竟然找了快一个小时。答案在这里:
http://stackoverflow.com/questions/3459098/create-list-of-single-item-repeated-n-times-in-python
输入:
['123'] * 5
输出:
['123', '123', '123', '123', '123']