Friday, 4 November 2016

Appending List

 HI,

See how to append a list using squares

-------------------------------------------------------------

items = [2, 3, 4, 5, 6]
squares = []
for x in items:
 squares.append(x ** 2)
print squares

-------------------------------------------------------------

No comments:

Post a Comment