<filename>list-comprehension.py
"""author: @pythonpips"""

numbers = [1, 2, 3, 4, 5]
squares = [x**2 for number in numbers]                        

# squares outputs: [1, 4, 9, 16, 25]

<filename>list-comprehension.py
"""author: @pythonpips"""

numbers = [1, 2, 3, 4, 5]
squares = [x**2 for number in numbers]                        

# squares outputs: [1, 4, 9, 16, 25]

author: @pythonpips # squares outputs: [1, 4, 9, 16, 25]