This is my list:
animals = ['dog', 'cat', 'mouse']
I want to split it so I end up with a string with the three strings inside the list, like this:
dog/cat/mouse
I have tried using the following code, but it just prints the original list:
print [e.split('/')[0] for e in animals]
Anything wrong?
You don’t want to
splityou want tojoin, somehow the reverse operation.