You now have all the knowledge necessary to begin writing list comprehensions! Your job in this exercise is to write a list comprehension that produces a list of the squares of the numbers ranging from 0 to 9.
Create list comprehension: squares
squares = [i**2 for i in range(0,10)]
[[output expression] for iterator variable in iterable]
原文:https://www.cnblogs.com/gaowenxingxing/p/12286778.html