what's the difference between a list and an array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what's the difference between a list and an array

list or array

15th Jul 2016, 5:53 PM
Francis Ifionu Marcel
Francis Ifionu Marcel - avatar
4 Answers
+ 2
in python, list is a collection of several data items which maybe of similar type or maybe dissimilar type. whereas, the array is collection of similar data items.. there is no multidimensional array in Python. this can implement by list..
17th Jul 2016, 3:23 AM
Abhishek dubey
Abhishek dubey - avatar
+ 1
A list can contain different data types but array can only contain similar data types
15th Jul 2016, 6:30 PM
Dinesh joshi
+ 1
A list can contain different data types (integers, floats, strings, lists, etc.), while arrays contain only one data type (the first one in the index; it can be anything "listable"). Arrays are much more useful when you have few data types to work with as they are usually faster (noticeable on slower devices).
15th Jul 2016, 7:17 PM
blabla blabla
blabla blabla - avatar
0
list is 1D while array is 2D. imagine excel sheet as array, with data on x-axis and y-axis.
26th Nov 2016, 7:01 AM
Fadi Elrami