Python List Construction

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

 

Example:

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']

>>>

 


Copyright 2023 © pythontic.com