them as needed the main reason to use dictionary is to make information lookup faster the key is always short and unique so that the computer doesn' spend lot of time looking for the information you need the following sections demonstrate how to create and use dictionary when you know how to work with dictionariesyou use that knowledge to make up for deficiencies in the python language most languages include the concept of switch statementwhich is essentially menu of choices from which one choice is selected python doesn' include this optionso you must normally rely on if elif statements to perform the task (such statements workbut they aren' as clear as they could be creating and using dictionary creating and using dictionary is much like working with listexcept that you must now define key and value pair here are the special rules for creating keythe key must be unique when you enter duplicate keythe information found in the second entry wins -the first entry is simply replaced with the second the key must be immutable this rule means that you can use stringsnumbersor tuples for the key you can'thoweveruse list for key you have no restrictions on the values you provide value can be any python objectso you can use dictionary to access an employee record or other complex data the following steps help you understand how to use dictionaries better open python shell window you see the familiar python prompt type colors {"sam""blue""amy""red""sarah""yellow"and press enter python creates dictionary containing three entries with people' favorite colors notice how you create the key and value pair the key comes firstfollowed by colon and then the value each entry is separated by comma type colors and press enter you see the key and value pairsas shown in figure - howevernotice that the entries are sorted in key order dictionary automatically keeps the keys sorted to make access fasterwhich means that you get fast