Section 1. Chapter 6
single
Challenge: Word Counter
Swipe to show menu
Task
Swipe to start coding
Write a function that counts how many times a specific word appears in a sentence.
- Receive a
sentenceand awordas arguments. - Count the number of times
wordappears insentencewhen splitting the sentence into words by whitespace. - Return the count as an integer.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat