Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想做以下事情:
l = list() l[2] = 'two'
正如预期的那样,这是行不通的。它返回一个超出范围的异常。
有什么方法可以定义一个长度为的列表?
试试这个
values = [None]*1000
代替 1000 使用您想要的数字。