Advertisements
Advertisements
प्रश्न
Give one point of difference between an array and a list in Python.
अंतर स्पष्ट करें
Advertisements
उत्तर
| 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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
