Crumbs

Python List Comprehensions – The Fast Way to Create Lists

squares = [x**2 for x in range(1, 6)]
print(squares)
# Output: [1, 4, 9, 16, 25]