human
function replaces all occurences of old with new in a string.
assistant
Here is a Python function to replace all occurences of old with new in a string

import re

def replace_all(string, old, new):
    """
    Replaces all occurences of old with new in a string
    """
    return string.replace(old, new)

# Enter the string
string = "lilly lilly lilly"

# Enter the old and new strings
old = "lilly"
new = "lilly"

# Calling the function
print((replace_all(string, old, new)))

#Example Output
# lilly lilly lilly

#Remember to inspect code for bugs.