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
Write a program that asks the user to enter a date in MM/DD/YYYY format that is typical for the US, the Philippines, Palau, Cana
stepladder [879]

Answer:

In Python:

txt = input("Date in MM/DD/YYYY format: ")

x = txt.split("/")

date=x[1]+"."

if(int(x[1])<10):

   if not(x[1][0]=="0"):

       date="0"+x[1]+"."

   else:

       date=x[1]+"."

   

if(int(x[0])<10):

   if not(x[0][0]=="0"):

       date+="0"+x[0]+"."+x[2]

   else:

       date+=x[0]+"."+x[2]

else:

   date+=x[0]+"."+x[2]

   

print(date)

Explanation:

From the question, we understand that the input is in MM/DD/YYYY format and the output is in DD/MM/YYYY format/

The program explanation is as follows:

This prompts the user for date in MM/DD/YYYY format

txt = input("Date in MM/DD/YYYY format: ")

This splits the texts into units (MM, DD and YYYY)

x = txt.split("/")

This calculates the DD of the output

date=x[1]+"."

This checks if the DD is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[1])<10):

If true, this checks if the first digit of DD is not 0.

   if not(x[1][0]=="0"):

If true, the prefix 0 is added to DD

       date="0"+x[1]+"."

   else:

If otherwise, no 0 is added to DD

       date=x[1]+"."

   

This checks if the MM is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[0])<10):

If true, this checks if the first digit of MM is not 0.

   if not(x[0][0]=="0"):

If true, the prefix 0 is added to MM and the full date is generated

       date+="0"+x[0]+"."+x[2]

   else:

If otherwise, no 0 is added to MM and the full date is generated

       date+=x[0]+"."+x[2]

else:

If MM is greater than 10, no operation is carried out before the date is generated

   date+=x[0]+"."+x[2]

This prints the new date

print(date)

8 0
3 years ago
What is the leading use of computers
nadya68 [22]

Answer:

email, texting and social networking

3 0
3 years ago
Read 2 more answers
Select the processes that help to create a program.
notsponge [240]

Answer:

See the explanation

Explanation:

I dont quite understand the question, but I assume we are asked to pick/ check the related action that could help create a program. So I would pick following actions:

O begin with an idea

O translate the pseudocode into Java programming code

O compile the Java code control unit

O execute the program

4 0
3 years ago
To make the most informed purchasing decision, you should:
musickatia [10]

Answer:

its either A or B but im leaning more towards B

Explanation:

6 0
2 years ago
The first fully automatic computer was​
umka2103 [35]

Answer:

Z3

Explanation:

The Z3 was a German electromechanical computer designed by Konrad Zuse in 1935, and completed in 1941. It was the world's first working programmable, fully automatic digital computer.

6 0
3 years ago
Other questions:
  • Which of these can be considered data?
    14·2 answers
  • Solving a current problem with existing information gathered for another purpose is ____research
    11·2 answers
  • As you explore career options why is it important to take personal inventory is and assessments
    13·2 answers
  • Marty uses a customized database to sort parts and track inventory. The customized database is an example of _____.
    14·1 answer
  • The ________ is responsible for the Internet's domain name system and the allocation of IP addresses.
    12·1 answer
  • When creating a shape in Word, what are some available options? Check all that apply. adding text to the shape changing the size
    6·1 answer
  • The network backbone
    11·1 answer
  • What is eight bits of data called?
    13·1 answer
  • Give an example of how loops are used in programming Kturtle​
    7·1 answer
  • Why do you need to learn about engineering and technology.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!