( ( (log ( performance of python data structures now that you have general idea of big- notation and the differences between the different functionsour goal in this section is to tell you about the big- performance for the operations on python lists and dictionaries we will then show you some timing experiments that illustrate the costs and benefits of using certain operations on each data structure it is important for you to understand the efficiency of these python data structures because they are the building blocks we will use as we implement other data structures in the remainder of the book in this section we are not going to explain why the performance is what it is in later you will see some possible implementations of both lists and dictionaries and how the performance depends on the implementation lists the designers of python had many choices to make when they implemented the list data structure each of these choices could have an impact on how fast list operations perform to help them make the right choices they looked at the ways that people would most commonly use the list data structure and they optimized their implementation of list so that the most common operations were very fast of course they also tried to make the less common operations fastbut when tradeoff had to be made the performance of less common operation was often sacrificed in favor of the more common operation two common operations are indexing and assigning to an index position both of these operations take the same amount of time no matter how large the list becomes when an operation like this is independent of the size of the list they are ( another very common programming task is to grow list there are two ways to create longer list you can use the append method or the concatenation operator the append method is ( howeverthe concatenation operator is (kwhere is the size of the list that is being concatenated this is important for you to know because it can help you make your own programs more efficient by choosing the right tool for the job let us look at four different ways we might generate list of numbers starting with first we will try for loop and create the list by concatenationthen we will use append rather than concatenation nextwe will try creating the list using list comprehension and finallyand perhaps the most obvious wayusing the range function wrapped by call to the list constructor the following code shows making our list in four different ways def test () [ algorithm analysis