How do you replace every word after index[3] in list?
For example, I need to change first word to "How's" and second word to "it" and third word to "going?". Then, I need to change every word to "yo" after index[3]:
input = "My name is bla bla bla?"
output = "How's it going? Yo! Yo! Yo!"
This is what I have so far:
def hellohello(input):
if type(input) != str:
return "Input has to be string"
else:
new_input = input.split(' ')
if len(input) <= 3:
return "How's it going?"
else:
new_input[0] = "How's "
new_input[1] = "it "
new_input[2] = "going? "
new_input[3:] = ["Yo! "]
output = ''.join(new_input)
return output
print hellohello("why is this not printing more yo")
So far I only get:
How's it going? Yo!