Sektion 1. Kapitel 6
single
Challenge: Word Counter
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 6
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat