human
Give me a Python code to split based on multiple characters in the Python code.
assistant
Here is a Python code to split based on multiple characters in the Python code

import re

def split_on_multiple_chars(s, chars):
    """Split a string `s` on multiple characters `chars`."""
    return [s[i:j] for i, j in enumerate([0] + [i for i, c in enumerate(s) if c in chars])]

# Enter the string
string = "carnation"

# Calling the function
print((split_on_multiple_chars(string, ["a", "n"])))

#Example Output
# ['', '', 'r', 'n', 'atio']

#Remember to inspect code for bugs.