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
Replace None in list with leftmost non none value