human
Can you show me a Python function for location of substring in string.
assistant
Here is a Python function for location of substring in string

import re

def find(string, sub):
    """Returns the location of substring in string."""
    return string.find(sub)

# Enter the string
string = "Hello, world!"

# Enter the substring
sub = "world"

# Calling the function
print((find(string, sub)))

#Example Output
# 7

#Remember to inspect code for bugs.