English

Give one point of difference between an array and a list in Python.

Advertisements
Advertisements

Question

Give one point of difference between an array and a list in Python.

Distinguish Between
Advertisements

Solution

Basis of Difference Array Python List
Data type of elements Usually stores elements of the same data type. Can store elements of different data types.
Size Traditionally has a fixed size. Has variable length; elements can be added or removed.
Storage Stores contiguous values of a similar type. Stores contiguous references (pointers) to objects.
Example An array of integers [4, "Good", 8.45, "k"]
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Liner List Manipulation - EXERCISE [Page 104]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 5 Liner List Manipulation
EXERCISE | Q 3. | Page 104
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×