if __name__ == "__main__"
Link: http://stackoverflow.com/questions/419163/what-does-if-name-main-do
DICTIONARY
A dictionary is an associative array (also known as hashes). Any key of the dictionary is associated (or mapped) to a value. The values of a dictionary can be any Python data type. So dictionaries are unordered key-value-pairs
Example:
>>> empty = {}
>>> empty
>>> a = dict () #a is an dictionary with empty value
>>> food = {"ham" : "yes", "egg" : "yes", "spam" : "no" }
>>> food["spam"] = "yes"
METHODS GET AND ITEMS
Method get(): The method get() returns a value for the given key. If key is not available then returns default value None.
Syntax
Following is the syntax for get() method −
dict.get(key, default=None)
Parameters
key -- This is the Key to be searched in the dictionary.
default -- This is the Value to be returned in case key does not exist.
Return Value
This method return a value for the given key. If key is not available, then returns default value None.
METHOD: Items() Returns a list of dict's (key, value) tuple pairs
Reference: http://www.tutorialspoint.com/python/python_dictionary.htm