给定一组文本和一个关键字，写一个Python函数来计算该关键字在文本中出现的次数。


def count_keyword_occurrences(text, keyword):
# TODO: 实现计算关键字在文本中出现次数的代码
return ...
text = "This is an example sentence for counting keyword occurrences."
keyword = "example"
print(count_keyword_occurrences(text, keyword))
可以使用Python中的count()函数计算文本中关键字出现的次数：

```python
def count_keyword_occurrences(text, keyword):
    return text.count(keyword)

text = "This is an example sentence for counting keyword occurrences."
keyword = "example"
print(count_keyword_occurrences(text, keyword))  # 输出：1
```