Check sibling questions

The data type list allows manipulation of its contents through various operations concatenation, repetition, membership and slicing.

Concatenation

Python allows us to join two or more lists using the concatenation operator depicted by the symbol ‘+’.

 

Lists l1 and l2 remain the same after the concatenation operation.

Repetition

Python allows us to replicate a list using repetition operator depicted by symbol *.

Membership

In operator

The membership operator ‘in’ checks if the element is present in the list and returns True, else returns False.

 

Not in operator

The not in operator returns True if the element is not present in the list, else it returns False.

 

Slicing

In Python, to access some part of a list , we use a method called slicing. This can be done by specifying an index range. 

Syntax:

List[ Initial : End : IndexJump ]

 

  1. Computer Science - Class 11
  2. Chapter 9 Class 11 - Lists

About the Author

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo