[ create a new paste ] login | about

Link: http://codepad.org/Yz7rjDVT    [ raw code | output | fork ]

Python, pasted on Feb 29:
1
2
3
4
L = [1,2,None,None,5]
for n, x in enumerate(L):
    if x is None: del L[n]
print(L)


Output:
1
[1, 2, None, 5]


Create a new paste based on this one


Comments: