In Python, what is difference between Array and List?

0 votes
Mar 15 in Python by Shabnam
• 400 points
267 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Lists and arrays are used in Python to store data(any data type- strings, integers etc), both can be indexed and iterated also. Difference between lists and arrays are the functions that you can perform on them like for example when you want to divide an array by 4, the result will be printed on request but in case of a list, python will throw an error message. Here's how it works: 

Arrays need to be declared whereas lists do not need declaration because they are a part of Python's syntax. This is the reason lists are  more often used than arrays. But in case you want to perform some arithmetic function to your list, one should go with arrays instead. 

If you want to store a large amount of data, then you should consider arrays because they can store data very compactly and efficiently.

answered Mar 15 by Taj
• 560 points

edited Mar 18 by Omkar

Related Questions In Python

+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 56,140 points
91 views
0 votes
0 answers

What is the difference between print and return in python?

If we get the same output why ...READ MORE

May 23 in Python by Waseem
• 2,630 points

edited May 24 by Omkar 11 views
0 votes
0 answers

What is the difference between isdigit, isnumeric and isdecimal in python?

Can you give examples for each of ...READ MORE

May 31 in Python by Waseem
• 2,630 points
17 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
54 views
+4 votes
6 answers
0 votes
1 answer

.join() method is used for what purpose in Python?

join() method is used to concatenate or ...READ MORE

answered May 14 in Python by Taj
• 560 points
12 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.