{ { for in aprint (iprint ( { useful way to construct lists is by list comprehensionthat isby expressions of the form list comprehension for in if for sets similar construction holds in this waylists and sets can be defined using very similar syntax as in mathematics comparefor examplethe mathematical definition of the sets :{ { (no order and no duplication of elementsand :{ awith the python code below seta { setb { ** for in setaprint (setblista [ listb [ ** for in lista print listb { [ dictionary is set-like data structurecontaining one or more key:value pairs enclosed in curly brackets the keys are often of the same typebut do not have to bethe same holds for the values here is simple examplestoring the ages of lord of the rings characters in dictionary dictionary dict {'gimly ' 'frodo ': 'aragorn ' for key in dictprint (key dict[key ]gimly frodo aragorn classes recall that objects are of fundamental importance in python -indeeddata types and functions are all objects class is an object typeand writing class definition can be thought of as creating template for new type of object each class contains number of attributesincluding number of inbuilt methods the basic syntax for the creation of class isclass