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
Nesterboy [21]
3 years ago
11

Define a function below called average_strings. The function takes one argument: a list of strings. Complete the function so tha

t it returns the average length of the strings in the list. An empty list should have an average of zero. Hint: don't forget that in order to get a string's length, you need the len function.
Computers and Technology
1 answer:
tester [92]3 years ago
6 0

Answer:

def average_strings(lst):

   total_length = 0

   avg = 0

   for s in lst:

       total_length += len(s)

   avg = total_length/len(lst)

   return avg

Explanation:

Create a function called average_strings that takes one parameter, lst

Initialize the total length and avg variables

Create a for loop that iterates through the lst. Get each string's length and put it to the total length

When the loop is done, calculate the average, divide total length by length of the lst

Return the average

You might be interested in
Since the actions in a textual storyboard are often very close to actual program code, the statements in a textual storyboard ar
Kaylis [27]

Answer: Pseudo code

Explanation:Pseudo code is a false code that is written in the textual story board to make the fictional plot of the story more understandable in the layman terms for everyone.This is done to increase the readability of the code , which cannot be understood easily by the actual code.

It is implemented on the algorithms of a program in computer field so that the complex coding statements can be understood by the programmer.

7 0
3 years ago
Which of the following is NOT a popular computer programming
cestrela7 [59]
Answer is Xero. All the other Languages are Popular and Widely Used.
Thank You!
6 0
2 years ago
What is the main task of the project manager
WINSTONCH [101]

Answer:

to handle day to day operations of a project A P E X

Explanation:

hope that helped

6 0
3 years ago
Read 2 more answers
HELP!!!<br> THIS HAPPENS EVERY TIME
Lelu [443]
Idek but hope u figure it out!
4 0
3 years ago
Read 2 more answers
Which is the highest level of the hierarchy of needs model?
navik [9.2K]
I believe the answer is C.
5 0
3 years ago
Other questions:
  • Boolean expressions are named after ____
    9·1 answer
  • How do I answer a question that was answered incorrectly on Brainly
    10·2 answers
  • What technique involves graphical methods and nontechnical language that represent the system at various stages of development a
    14·1 answer
  • Write programs in python to display “Valid Voter”. (condition : age of person should be
    15·1 answer
  • What colorful format should you use to bring attention to an important sentence or phrase
    14·1 answer
  • 19 dollar fortnite gift card
    14·2 answers
  • The field names in a database are also known as__?
    12·2 answers
  • Need help with python coding
    12·2 answers
  • Two technicians are discussing Newton's first law of motion. Technician A says that a lightweight vehicle requires as
    8·1 answer
  • When Alice turned on her laptop this morning, the screen displayed only colorful horizontal lines. Which of the following is mos
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!