subject

Your friend really likes talking about owls. Write a function owl_count that takes a block of text and counts how many words they say have word “owl” in them. Any word with “owl” in it should count, so “owls,” “owlette,” and “howl” should all count. Here’s what an example run of your program might look like:

text = "I really like owls. Did you know that an owl's eyes are more than twice as big as the eyes of other birds of comparable weight? And that when an owl partially closes its eyes during the day, it is just blocking out light? Sometimes I wish I could be an owl."
owl_count(text)
# => 4
Hints

You will need to use the split method!

Here is what I have so far, it doesn not like count = 0 and i keep getting an error.
def owl_count(text):

count = 0

word = 'owl'

text = text. lower()

owlist = list(text. split())

count = text. count(word)

text = "I really like owls. Did you know that an owl's eyes are more than twice as big as the eyes of other birds of comparable weight? And that when an owl partially closes its eyes during the day, it is just blocking out light? Sometimes I wish I could be an owl."
print (count)

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 14:00, ashley1460
Mr. johnson creates a game in which the players see the world from their avatar’s perspective. what genre of game is this?
Answers: 2
image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 23.06.2019 02:00, rah45
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
image
Computers and Technology, 24.06.2019 12:30, coursonianp8izbc
Do you think media is stereotype ? and why?
Answers: 1
You know the right answer?
Your friend really likes talking about owls. Write a function owl_count that takes a block of text a...

Questions in other subjects: