+ 1
What's the difference between lists and arrays and does python has arrays? (if they're not the same thing)
2 ответов
+ 1
NOT AT ALL !!!! an array has a fixed size , and you need a lib like numpy to use them. the thing is they are reliable in terms of cost : you always need the same number of operations to read a value.
list in python are not what lists are in most langages : in python, lists are big arrays that are erased and copied to an even bigger array when you fill them too much (not ALL their values are relevant, and some number indicates the point where values stop being relevant) .
sometimes adding a value is free, sometimes is very costly.
+ 1
sounds like the same