Python List Construction

Construct a python list by specifying the set of values inside square brackets and print the python list in the console

List Updated 11 Sep 2016 1 min read

A python list object is constructed by specifying the set of elements inside square brackets.

Example

python
MyMac:~ macuser$ python

Python 3.4.2 |Anaconda 2.1.0 (x86_64)| (default, Oct 21 2014, 17:42:20)

[GCC 4.2.1 (Apple Inc. build 5577)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> SequenceTypesInPython = ["Strings","Tuples","Bytes","Lists","Byte Arrays","Array","Collections"];

>>> print(SequenceTypesInPython);

['Strings', 'Tuples', 'Bytes', 'Lists', 'Byte Arrays', 'Array', 'Collections']

>>>