在可读性和性能方面,我应该使用 为数组预分配内存吗[None]*n?分配一个空的[]并.append()反复使用是否算浪费?
[None]*n
[]
.append()
python performance
performance ×1
python ×1