I've used JavaScript before where we use arrays. I'm following a textbook that teaches Python. I'm now learning about lists. They sound exactly like arrays. Is list simply the Python word for array, or does Python have arrays and lists which are different things?
3 Answers
Yes, lists are the data structure in Python.
Sidenote: Numpy (a python library) has arrays
But, as pointed out in the comments Python does, in-fact, have an array module. Which is a list of all the same data types
2 Comments
jonrsharpe
Also the Python standard library has arrays, so it's not quite so clear cut: docs.python.org/3/library/array.html
OneCricketeer
True. I'd say, for learning purposes, a list is the preferred data structure