Jump Start with Python Lists

The most basic data structure in Python is sequence. A sequence is an abstract data type that represents an ordered sequence of values (items), where the same value may occur more than once. Python has six built-in types of sequences but among them most common are lists and tuples.
List is the most versatile data type in Python, It can also be termed as “Python’s Workhorse Data Type“. Lists in Python can be written as a list of comma-separated values (items) enclosed between square brackets irrespective of their type.

Creating a List:

list_name=["item1", "item2", "item3", --------- , "itemn"]

fruits=["Mango", "Orange", "Banana", "Grapes", "Pomegranate", "Apple", "Pineapple"]

Python List Example

Accessing Lists:

Python allows accessing values of a list using list indices i.e. list element index which starts from 0. Multiple elements of list can be accessed using slicing range of elements from the list. Some other access operations performed on lists are as below:

  • Updating Lists
  • Deleting Lists
Basic List Operations:

List responds to almost all basic operations and some of them are listed as below:

  • Length Operation
  • Concatenation Operation
  • Repetition Operation
  • Membership Operation
  • Iteration Operation
List Methods & Functions:

  • Maximum Method
  • Minimum Method
  • Convert to List Method
  • Append Method
  • Count Method
  • Extend Method
  • Object Index Method
  • Index Insert Method
  • Remove Method
  • Pop Method
  • Sort Method
  • Reverse Method

My article “Jump Start with Python Lists – Part Six” is the sixth article in series, and explains how to get started with programming in Python at C# Corner. Click the link below to read the article:

Read Article

To read “Jump Start with Python Numbers – Part 5“, Click Here

Leave a Reply

Your email address will not be published. Required fields are marked *