Open chrisoemma opened 4 years ago
Python lists and arrays are very similar in that they are both used to store a collection of data. This entails, most operations that can be performed on a typical a c-like array can be performed on any python list.
The main difference between python lists and arrays is that, lists can works with data of different numeric types while arrays must work with data of one numeric type.
Generally, I would use lists in most cases as they are natively supported and widely used by other libraries. However, I would definitely use arrays if the case is to work with data where their numeric type matters and needs to be the same.
What is the difference between python lists and arrays?
I understand that we can treat lists as arrays, but, what happens when I create an array using the
array
module?