• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Python by
Q:
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

+1 vote
asked May 27, 2019 in Data Handling by tempuser
+1 vote
asked Jan 16, 2020 in QuickTest Professional (QTP) by JackTerrance
...