1.

How are lists different from strings when both are sequences ?

Answer» The lists and strings are different in following ways :

(a) The lists are mutable sequences while strings are immutable.

(b) Strings store single type of elements, all characters while lists can store elements belonging to different types.

(c) In consecutive locations, strings store the individual characters while list stores the references of its elements.


Discussion

No Comment Found