python
text = "Big brown bears and beautiful blue birds gather in the bushes behind the bakery"
b_words = 0
for word in text.split():
if word.startswith('b') or word.startswith('B'):
b_words += 1
print(f"There are {b_words} words starting with the letter B.")
Результат выполнения программы:
There are 4 words starting with the letter B.
Код разбивает строку на слова и далее проверяет каждое слово, начинается ли оно с буквы B или b. Если это так, то мы увеличиваем `b_words` на 1. В конце код выводит общее количество найденных слов, начинающихся с буквы B.