def partial_k(f, k, seq):
    seq = tuple(seq)

def wrapper(x):
    return f(*(seq[:k] + (x,) + seq[k:]))
return wrapper
print(partial_k(f, 2, [0, 1])(10))
print(partial_k(f, 1, [0, 1])(10))
Freezing all but one positional arguments