def replaceNoneWithLeftmost(val):
    for i in range(len(val)):
        if val[i] is None:
            for j in range(i - 1, -1, -1):
                if val[j] is not None:
                    val[i] = val[j]
break
for i in range(len(val)):
    if val[i] is None:
        for j in range(i + 1, len(val)):
            if val[j] is not None:
                val[i] = val[j]
break
return val
Заменить None в списке крайним левым значением non none