#Code to calculate square of each number of list using list comprehension
squares = [lambda num = num: num ** 2 for num in range(0, 11)]
for square in squares:
print( square(), end = " ")
OUTPUT:
================================================================ RESTART: C:/Users/mhtpr/Documents/FormatFactory/fun1.py ===============================================================
0 1 4 9 16 25 36 49 64 81 100