1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andrews [41]
3 years ago
9

Your friend really likes talking about owls. Write a function owl_count that takes a block of text and counts how many words the

y 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)
Computers and Technology
1 answer:
andriy [413]3 years ago
4 0
Text = “ I really like owls. Did you know that an owls 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.

word = ‘owl’
texts = text.lower()
owlist = list(texts.split())
count = text.count(word)
num = [owlist, count] #num has no meaning just random var
print(num)


Alter in anyway you want so that you can succeed. ✌
You might be interested in
Why are the keys on the qwerty keyboard arranged the way they are?
sveticcg [70]
Sholes arranged the keys in their odd fashion to prevent jamming on mechanical typewriters by separating commonly used letter combinations.
7 0
2 years ago
Taking a suitable example in c language explain the of call by value and call by reference concepts.
Degger [83]

Answer: The difference between call by value and call by reference is that in call by value the actual parameters are passed into the function as arguments whereas in call by reference the address of the variables are sent as parameters.

Explanation:

Some examples are:

call by value

#include <stdio.h>  

void swap(int, int);

int main()

{  int a = 10, b= 20;

 swap(a, b);

 printf("a: %d, b: %d\n", a, b);

}  

void swap(int c, int d)

{

 int t;

 t = c; c = d; d = t;

}  

OUTPUT

a: 10, b: 20

The value of a and b remain unchanged as the values are local

//call by reference

#include <stdio.h>

 void swap(int*, int*);

 int main()

{

 int a = 10, b = 20;

 swap(&a, &b);   //passing the address

 printf("a: %d, b: %d\n", a, b);

}

void swap(int *c, int *d)

{

 int t;

 t = *c; *c = *d; *d = t;

}

OUTPUT

a: 20, b: 10

due to dereferencing by the pointer the value  can be changed which is call by reference

8 0
3 years ago
Choose the correct term to complete the sentence.
Alex

Answer:

the answer to your question is obviously "rational"

3 0
2 years ago
Write 3 3 advantage and disadvantage of computer​
navik [9.2K]

Answer:

Advantages: computers don't make human error

It can be used for communication

Ease of access

Disadvantages: computers can be a distraction

Potential loss of privacy

It can limit learning and create a dependency

8 0
2 years ago
The data table provides the results of several what-if analyses, but results are often clearer if you include a(n
r-ruslan [8.4K]
CVP Chart.
Source: "New Perspectives on Microsoft Excel 2010: Comprehensive" by June Parsons, Dan Oja, Roy Ageloff, Patrick Carey.
4 0
2 years ago
Other questions:
  • Bushman and bonacci (2004) found that prejudiced participants were ____ likely to return a lost e-mail that had been addressed t
    5·1 answer
  • Which of the following are typically an example of primary resources?
    13·1 answer
  • 1. Which of the following statements are true about routers and routing on the Internet. Choose two answers. A. Protocols ensure
    9·2 answers
  • Please find one organization that has recently adopted virtualization and summarize their reasons for taking this approach. What
    12·1 answer
  • Which one of these is correct PI of a XML document?
    13·1 answer
  • An invisible path determining the way of travel from one place to another.
    10·1 answer
  • Help meee pleaseeee
    5·1 answer
  • The act of illegally copying software, music,or movies that are copied protect?
    7·2 answers
  • Which of the following is an operating system?<br> MacBook Air<br> Windows 10<br> Dell
    13·2 answers
  • HELP 20 points THIS IS ON EDGE IF YOU DON'T KNOW THE ANSWER DON'T RESPOND
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!