Python By Code
Wednesday, July 8, 2015
List comprehensions :
provide a concise way to create lists.
squares = []
for x in range(10):
squares.append(x**2)
squares
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Delete element from list
a = [-1, 1, 66.25, 333, 333, 1234.5]
del a[0]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment