0 votes
in Python by
How do Python arrays and lists differ from each other?

1 Answer

0 votes
by

The difference between Python array and Python list are as follows:

Arrays Lists

Array is defined as a linear structure that is used to store only homogeneous data. List are used to store arbitrary and heterogenous data

Since array stores only similar type of data so it occupies less amount of memory when compared to list. List stores different types of data so it requires huge amount of memory 

Length of the array is fixed at the time of designing and no more elements can be added in the middle. Length of the list is no fixed, and adding items in the middle is possible in lists.

Related questions

0 votes
asked Sep 5, 2021 in Python by SakshiSharma
0 votes
asked May 12, 2023 in Python Flask by SakshiSharma
...