Here’s a couple of ways:
[] if not a_list else [a_list[0], *filter(None, a_list[1:])]
[e for i, e in enumerate(a_list) if not (e is None and i)]
solved Delete empty values from a list but the element with index 0
Here’s a couple of ways:
[] if not a_list else [a_list[0], *filter(None, a_list[1:])]
[e for i, e in enumerate(a_list) if not (e is None and i)]
solved Delete empty values from a list but the element with index 0