named tuples are perfect for many "data onlyrepresentationsbut they are not ideal for all situations like tuples and stringsnamed tuples are immutableso we cannot modify an attribute once it has been set for examplethe current value of my company' stock has gone down since we started this discussionbut we can' set the new valuestock current traceback (most recent call last)file ""line in attributeerrorcan' set attribute if we need to be able to change stored dataa dictionary may be what we need instead dictionaries dictionaries are incredibly useful containers that allow us to map objects directly to other objects an empty object with attributes to it is sort of dictionarythe names of the properties map to the property values this is actually closer to the truth than it soundsinternallyobjects normally represent attributes as dictionarywhere the values are properties or methods on the objects (see the __dict__ attribute if you don' believe meeven the attributes on module are storedinternallyin dictionary dictionaries are extremely efficient at looking up valuegiven specific key object that maps to that value they should always be used when you want to find one object based on some other object the object that is being stored is called the valuethe object that is being used as an index is called the key we've already seen dictionary syntax in some of our previous examples dictionaries can be created either using the dict(constructor or using the {syntax shortcut in practicethe latter format is almost always used we can prepopulate dictionary by separating the keys from the values using colonand separating the key value pairs using comma for examplein stock applicationwe would most often want to look up prices by the stock symbol we can create dictionary that uses stock symbols as keysand tuples of currenthighand low as values like thisstocks {"goog"( )"msft"( )