Generate a program to extract the substring from a given string
string = 'Python is fun'
start = 7
end = 11
def extract_substring(string, start, end):
    substr = string[start : end]
    return substr

string = 'Python is fun'
start = 7
end = 11

print(extract_substring(string, start, end))