Remove a value in place

Write remove_value(items, target) that moves every item that is not target to the front of the list, keeping their order, and returns how many there are. What is left in the list after that count does not matter. Change the list you are given.

items = [3, 2, 2, 3];  k = remove_value(items, 3)  ->  k == 2 and items[:2] == [2, 2]
items = [0, 1, 2, 2, 3, 0, 4, 2];  k = remove_value(items, 2)  ->  k == 5 and items[:5] == [0, 1, 3, 0, 4]

The point is to practise slow and fast pointers writing in place.

def remove_value(items, target):
    ...