squares finallywhen the loop has finished runningthe list of squares is printed at [ to write this code more conciselyomit the temporary variable square and append each new value directly to the listsquares [for value in range( , ) squares append(value** print(squaresthe code at does the same work as the lines at and in squares py each value in the loop is raised to the second power and then immediately appended to the list of squares you can use either of these two approaches when you're making more complex lists sometimes using temporary variable makes your code easier to readother times it makes the code unnecessarily long focus first on writing code that you understand clearlywhich does what you want it to do then look for more efficient approaches as you review your code simple statistics with list of numbers few python functions are specific to lists of numbers for exampleyou can easily find the minimummaximumand sum of list of numbersdigits [ min(digits max(digits sum(digits note the examples in this section use short lists of numbers in order to fit easily on the page they would work just as well if your list contained million or more numbers list comprehensions the approach described earlier for generating the list squares consisted of using three or four lines of code list comprehension allows you to generate this same list in just one line of code list comprehension combines the for loop and the creation of new elements into one lineand automatically appends each new element list comprehensions are not always presented to beginnersbut have included them here because you'll most likely see them as soon as you start looking at other people' code working with lists