Python Lists and Tuples

--Originally published at Programming Fundaments

These are the most common build-in data type for python. These are used to store objects or values in a specific order. These are really easy to create. Here:

# Lists must be surrounded by brackets
>>> emptylst = []
# Tuples may or may not be surrounded by parenthesis
>>> emptytup = ()
Those were empty list. To create non-empty lists or tuples, the values are separated by commas:
# Lists must be surrounded by brackets
>>> lst = [1, 2, 3]
>>> lst
[1, 2, 3]
# Tuples may or may not be surrounded by parenthesis
>>> tup = 1, 2, 3
>>> tup
(1, 2, 3)
>>> tup = (‘one’, ‘two’, ‘three’)
>>> tup
(‘one’, ‘two’, ‘three’)
 (To create a tuple with only one value, add a trailing comma to the value.)
Example & More at: http://pythoncentral.io/python-lists-and-tuples/