Skip to main content

Posts

Showing posts with the label Class 11th Chapter 6 :- List Manipulation

ads1

Class 11th Chapter 6 :- List Manipulation

 Class 11th Chapter 6 :- List Manipulation 1. How are lists different from the strings when both are sequences ? SOLUTION, The lists and strings are different in following ways:  (i) The lists are mutable sequences while strings are immutable. (ii) In consecutive locations, strings store the individual characters while list stores the references of its elements. (ii) Strings store single type of elements - all characters while lists can store elements belonging to different types. Assume the following list definition in Python. 2. What are nested lists? SOLUTION. When a list is contained in another list as a member-element, it is called nested list, eg. 3. What is the difference between append() and extend() functions? SOLUTION. The append() can append only a single element to a list while extend() can append a list of elements to a list, eg >>> val = [17, 24, 15, 30] >>> val.extend([34, 27]) >>> val.append(44) >>> val [17, 24, 15, 38, 34, 27, 44] 4.

ads2