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
KatRina [158]
4 years ago
8

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:
Nady [450]4 years ago
8 0

Answer:

def average_strings(lst):

   total = 0

   if len(lst) == 0:

       return 0

   for s in lst:

       total += len(s)

   return total / len(lst)

Explanation:

Create a function called average_strings that take one parameter, lst

Initialize a total to hold the length of the strings in lst

If the length of lst is 0, return 0

Otherwise create a for loop that iterates through the lst. Calculate the length of each string in lst and add it to total

When the loop is done, return the average, total length of the strings divided by length of the lst

You might be interested in
The __________ process is designed to find and document vulnerabilities that may be present because there are misconfigured syst
erma4kov [3.2K]

Answer:

Isp

Explanation:

An Internet service provider is an organisation that provides services for accessing,

using, or participating in the Internet. Internet service providers can be organised in

various forms

6 0
3 years ago
Jasper, a businessperson, has no connection with Yale University, but he has a new line of computer software that he would like
zheka24 [161]

Answer:

The answer is letter D.

Explanation:

It is unlikely that Jasper will be able to register the name "Yale Software," because it falsely suggests a connection to an institution.

3 0
4 years ago
What is the output of the following program?
Alex787 [66]

Answer:

B:2 should be the first answer

C: 14 the second

7 0
3 years ago
A/an ____ file saves a workbook as a comma-delimited text file for use on another windows operating system??
aleksandrvk [35]

Answer:

The correct option is D

D) CVS

Explanation:

A CVS file saves a workbook as a comma-delimited text file for use on another windows operating system. It ensures that line breaks, tab characters and other characteristics are interpreted correctly.

A CVS file stands for Comma Separated Value file, which basically allows the data to be saved in tabular format. However they differ from other spreadsheet file types because you can only have a single sheet in a file. Moreover, you cannot save cell, column or row in it.

7 0
3 years ago
Microsoft Publisher - Assignment #1
Allisa [31]

Answer:1

Explanation:

6 0
3 years ago
Other questions:
  • How to calculate 100MB at 56 Kbps to transfer time?
    13·1 answer
  • What formula most likely exists in D18?
    5·1 answer
  • For homework, we have to figure out what's in the picture. It's " too close to tell " but I can't figure out what it is. Any ide
    11·1 answer
  • Which is a good plan for backing up data?
    6·1 answer
  • What are the benefits of transferable skills check all the boxes that apply
    6·2 answers
  • 1. Write a CFG to generate identifiers (IDs) in the Java Programming Language. An ID in Java is a string of characters consistin
    5·1 answer
  • Weak Induction
    8·1 answer
  • 19. Fair use applies to which of the following situations?
    14·1 answer
  • What are the pros and cons for E-trade?
    15·2 answers
  • Which computers were the first PCs with a GUI<br> MS-DOS <br> Linux<br> Windows<br> Mac
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!