PYTHON LIST DEFINATION
- February 18, 2021
- Posted by: AtoZ Trainings
- Category: Uncategorized
A list an ordered collection of values . A list is a mutable container. This means that we can add values, delete values , or modify existing values.
Python list represents a mathematical concept of a finite sequence. Values of list are called items or elements of the list. A list can contain the same value multiple times. Each occurrence is considered a distinct item.
PYTHON SIMPLE LIST
List elements can be accessed by their index. The first element has index 0, the last one has index
This is a simple list having five elements the list is delimited by [ ] square brackets the elements.
PYTHON LIST INITILIAZATION
Some times we need to initialize a list in advance to have a particular number elements
PYTHON LIST FUNCTION
The list () function creates a list from an iterable object . An iterable may be either a sequence a container that supports iteration, or an interator object . if no parameter is specified, a new empty list is created.
PYTHON LIST OPERATIONS
The following code shows some basic list operations.
PYTHON SEQUENCE FUNCTIONS
Sequence function can be used on any sequence types , including lists.
Ex: In the example above , we have four functions .
Len(), max(), mim(), and sum().
PYTHON ADDING ELEMENT LIST
This section will shows how elements over added a python list.