I use this notation
my_list = ["foo", "bar", "BAZ"] replacements = {'BAZ': 'baz'} my_list_updated: list = [ replacements.get(col, col) for col in my_list ]