two lists, sorted and original, merged solution in Clear category for Sort Except Zero by kkkkk
from typing import Iterable
def except_zero(items: list) -> Iterable:
"""Return sorted items, but leave zeros in their position."""
sorted_items = [item for item in sorted(items) if item != 0]
for idx, item in enumerate(items):
items[idx] = sorted_items.pop(0)
Feb. 29, 2020