Skip to main content

Python List Data type

Python has the List data type to store the multiple values. While we are creating a List varible, a Python List object is created for storing the list values. A List is a sequences of  multiple values in an ordered. A List starts and ends with squre Brackets([]).

Values inside the list are also defined as items. In order to, the list items are seperated with comma (,) within the square bracket([]) on List python data type.

The Python tutorial on Techtuts provides an information about Python and Python 3 from the basis to high level. This tutorial provides a good understanding about the Python and Python for Technical, Non-Technical People, College Students and Working Professionals. Given examples are an easy to write and simple to practice by yourself.

In this tutorial you will learn about the  Python and Python3. This tutorial includes  an Introduction, Python Environment Setup, Variables, Data types , Control flow Statements, Loops, Functions, Data Structures, Modules ,Files, Classes, Python Web Frameworks etc.

List

A List is a sequences of  multiple values in an ordered. Just like a string, the list  begins with openieng square bracket and closing  square bracket, [].

Example

>>> [1,2,3,4,5]
[1, 2, 3, 4, 5]
>>> ['get','net','pet','set']
['get', 'net', 'pet', 'set']
>>> ['set', 1.23, True, 37]
['set', 1.23, True, 37]
>>> listVar = ['get','net','pet','set']
>>> listVar
['get', 'net', 'pet', 'set']
>>> type(listVar)
<class 'list'>