![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 20.02.2021 01:40 Officaljazz18
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](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 22:00
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 06:30
What result from the passage of this amendment
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 14:40
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
![question](/tpl/images/cats/informatica.png)
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
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.12.2021 03:30
![question](/tpl/images/cats/mat.png)
Mathematics, 17.12.2021 03:30
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.12.2021 03:30
![question](/tpl/images/cats/mkx.png)
Arts, 17.12.2021 03:30
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.12.2021 03:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.12.2021 03:30
![question](/tpl/images/cats/biologiya.png)