Python Loop Through List Replacing Values