I want to do something to the effect of:
x = [" ","cats"]
def function(a):
a.split([any of the elements in x])
return a
How would I make Python accept any of the elements in x as an argument (so it splits as spaces and cats)?
Edit: Sorry, I should have probably specified: a is expected to be a list
(I'm really, really sorry for not being clear.)
input - a = "I love cats so much" expected output - ["I" , "love","so" , "much"]
Basically, I want it to perform the split function for " " and then for "cats".