+ 1

What's the difference between lists and arrays and does python has arrays? (if they're not the same thing)

14th Aug 2016, 1:12 PM
Ryu
Ryu - avatar
2 odpowiedzi
+ 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.
15th Aug 2016, 4:15 PM
Eliott Arlo Veyrier
Eliott Arlo Veyrier - avatar
+ 1
sounds like the same
16th Aug 2016, 7:49 AM
Freddie Jensen
Freddie Jensen - avatar