. Advertisement .
..3..
. Advertisement .
..4..
I would love to square each element of a list in python but I don’t know what is the best way to do it yet. Can you share with me more about the related knowledge?
Here is our case study:def square(a):
squares = []
for i in a:
squares.append(i**2)
return squares
1 Answer