Q:

Split string but replace with another string and get list

I am trying to split a string but it should be replaced to another string and return as a list. Its hard to explain so here is an example:  
I have string in variable a:  
a = "Hello World!"

I want a list such that:
a.split("Hello").replace("Hey") == ["Hey"," World!"]

It means I want to split a string and write another string to that splited element in the list. SO if a is
a = "Hello World! Hello Everybody"

and I use something like a.split("Hello").replace("Hey") , then the output should be:
a = ["Hey"," World! ","Hey"," Everybody"]

How can I achieve this?

A:

x = "HelloWorldHelloYou!" 
y = x.replace("Hello", "\nHey\n").lstrip("\n").split("\n") 
print(y) # ['Hey', 'World', 'Hey', 'You!']

This is a rather brute-force approach, you can replace \n with any character you're not expecting to find in your string (or even something like XXXXX). The lstrip is to remove \n if your string starts with Hello.
Alternatively, there's regex :) 

