list manipulation in python class 11 notes

chapter-7
list manipulation in python

class 11 notes

list manipulation in python class 11 notes

Introduction:-

List:-

Creating and Accessing lists:-

Creating lists

example:

Nested lists:-

list manipulation in python class 11 notes
list manipulation in python class 11 notes

Accessing lists:-

* length:

* indexing and slicing:

* membership operators

* concatenation and replication operator + and * :-

Accessing individual elements:-

Difference from strings:-

Traversing a list:-

The above loop will produce result as:

Q 1. program to print elements of list[‘q’,’w’,’e’,’r’,’t’,’y’] in separate lines along with element’s both indexes (positive and negative)

Sample run above program is :

Comparing lists:-

list manipulation in python class 11 notes
list manipulation in python class 11 notes

List operations:-

(1) joining lists

(2)Repeating or Replicating:-

(3)Slicing the lists