The data type list is an ordered sequence which is mutable and made up of one or more elements.

  • A list can have elements of different data types , such as integer, float, string, tuple or even another list. 
  • A list is very useful to group together elements of mixed data types. 
  • Elements of a list are enclosed in square brackets and are separated by comma. 
  • Like string indices, list indices also start from 0.

Accessing elements in a List

The elements of a list are accessed in the same way as characters are accessed in a string. 

The list items are accessed by referring to the index number in square brackets. 

 

Introduction to Lists in Python - Computer Science Class 11 Notes - Concepts

part 2 - Introduction to List - Concepts - Chapter 9 Class 11 - Lists - Computer Science - Class 11

 

Lists are Mutable

In python, lists are mutable ie.,  the contents of the list can be changed after it has been created.

part 3 - Introduction to List - Concepts - Chapter 9 Class 11 - Lists - Computer Science - Class 11

Remove Ads Share on WhatsApp
Davneet Singh's photo - Co-founder, Teachoo

Made by

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