Q. How are lists different from strings when both are sequences?


Answer =

The lists and strings are different in following ways:

(i) The lists are mutable sequences while strings are immutable.
(ii) In consecutive locations, a string stores the individual characters while a list stores the references of its elements.
(iii) Strings store single type of elements - all characters while lists can store elements belonging to different types.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post