Work with Python lists and dictionaries
masterPython uses two primary data structures for organizing data:
Lists
A list is a zero-based sequence of variables. You access elements using their index number inside square brackets [].
Dictionaries
A dictionary is a collection of key-value pairs. Unlike lists, you access values using a key (such as a string) inside square brackets [] rather than a numeric index.
# List example
mylist = [-5, 0.3, 2.5, 33]
print(mylist[1]) # Returns 0.3
# Dictionary example
mydict = {'name': 'John Doe', 'age': 32}
print(mydict['name']) # Returns 'John Doe'