[[ ,jfor in range( for in range( )[[ ][ ][ ][ ]this is the equivalent of the following codel [for in range( )for in range( ) append([ , ]here is another example[[ ,jfor in range( for in range( )[[ ][ ][ ][ ][ ][ ] using list comprehensions to further demonstrate the power of list comprehensionswe will do the first four examples of section in one line apiece using list comprehensions example write program that generates list of random numbers between and [randint( , for in range( )example replace each element in list with its square [ ** for in lexample count how many items in list are greater than len([ for in if > ]example given list that contains numbers between and create new list whose first element is how many ones are in lwhose second element is how many twos are in letc frequencies [ count(ifor in range( , )another example the join method can often be used with list comprehensions to quickly build up string here we create string that contains random assortment of letters from random import choice alphabet 'abcdefghijklmnopqrstuvwxyz 'join([choice(alphabetfor in range( )]