将列表初始化为Python中已知数量的元素[duplicate](Initializing a list to a known number of elements in Python [duplicate])
这个问题已经在这里有一个答案:
在一定大小的 6个答案的 python中创建一个空列表现在我正在使用一个列表,期待着像:
verts = list (1000)我应该使用数组吗?
This question already has an answer here:
Create an empty list in python with certain size 14 answersRight now I am using a list, and was expecting something like:
verts = list (1000)Should I use array instead?
最满意答案
我想到的第一件事是:
verts = [None]*1000但是你真的需要预先初始化它吗?
The first thing that comes to mind for me is:
verts = [None]*1000But do you really need to preinitialize it?
更多推荐
发布评论