user image

Preeti Tripathi

Job Interview Skills
English
2 years ago

22. What distinguishes lists from arrays in Python?

user image

Abhishek Mishra

2 years ago

Let us elaborate on the distinctions between Lists and Arrays in Python in the following points:The list is made up of elements with various data types. While Arrays only include elements of the same data type.No module has to be imported for list declaration. However, a module must be imported specifically in order to declare an array. The list can be nested to contain many types of elements while in Arrays all nested components must be similar in size. List is recommended for shorter data sequences while arrays are recommended for longer data sequences.Lists are more adaptable to enable simple data updates whether addition or deletion while Array is less flexible because additions and deletions must be made element by element.

Recent Doubts

Close [x]