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)
1
[1, 2, None, 5]