View Only

 Python Array

palak sharma's profile image
palak sharma posted 06-13-2022 01:04
Hi this is Palak Sharma, I am in third year of my engineering and my interest is in Python Language. I have little bit confusion about Python list and array, can anyone define both term including what is the difference in between both of them.
Looking for your positive response in this regards.
anushka agarwal's profile image
anushka agarwal
Hi Palak.

You can understand difference in both of them by below mention points.

1. Python List is used to collect items that usually consist of elements of multiple data types while an Array is also a vital component that collects several items of same data type.

2. Python List cannot manage arithmetic operations while an Array can manage arithmetic operations on efficient way.

3. Python List contains elements that belong to the different data types while Python Array contains elements that belong to the same data type.

4. Python List occupies larger memory while Python Array occupies less memory.

5. In Python list, the complete list can be accessed without doing any specific looping, while in Array loop is mandatory to access the components of the array.

6. When it comes to easy way to work as well as flexibility, the list is perfect as it allows easy modification of data as compare to Python Array.

The main approach or aim of both Lists and Array is almost same, only difference is in working.
For better understanding you can also check below link, fruitful information available in detailed.
Click here to get the detail of Python List.
Clcik here to get the detail of Python Array.

Hope this answer will help you