list comprehensions can also be used to replicate the action of nested loops in more compact form for examplewe multiply each of the elements contained within list with each otherwe can also use list comprehensions with other objects such as stringsto build more complex structures for examplethe following code creates list of words and their letter countas we will seelists form the foundation of many of the data structures we will look at their versatilityease of creationand use enables them to build more specialized and complex data structures functions as first class objects in pythonit is not only data types that are treated as objects both functions and classes are what are known as first class objectsallowing them to be manipulated in the same ways as built-in data types by definitionfirst class objects arecreated at runtime assigned as variable or in data structure passed as an argument to function returned as the result of function in pythonthe term first class object is bit of misnomer since it implies some sort of hierarchywhereas all python objects are essentially first class