句子是："This is an example sentence"
单词是："is"
创建一个程序来计算句子中单词的频率。
"""
创建一个程序来计算句子中单词的频率。

def calculate_word_frequency(sentence, word):
    words = sentence.split()
    word_count = words.count(word)
    return word_count

if __name__ == "__main__":
    sentence = "This is an example sentence"
    word = "is"
    word_count = calculate_word_frequency(sentence, word)
    print("单词 '" + word + "' 在句子中的频率为", word_count)
"""