python如何生成重复单一值的序列

因为是PYTHON新手,这个问题竟然找了快一个小时。答案在这里:

http://stackoverflow.com/questions/3459098/create-list-of-single-item-repeated-n-times-in-python


输入:

['123'] * 5

输出:

['123', '123', '123', '123', '123']

你可能感兴趣的:(Python)