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]
4 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]4 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
According to many experts how often should files be backed up
dezoksy [38]
Critical Files should be backed up daily.
5 0
3 years ago
Use a while loop to output the even number from 100 to 147? This is python
KiRa [710]

Answer:

def main():

 i = 100

 while(i < 148):

   print(i)

   i += 2

main()

Explanation:

7 0
2 years ago
Which of the following sentences is written in the active voice
STALIN [3.7K]
D. The chocolate cake will be served to the queen. This is the only one not in past tense. Active means present or near present, hence the word "will." 
3 0
4 years ago
Read 2 more answers
Write a program that reads an arbitrary number of integer that are in the range 0 - 50 inclusive and counts how many occurrences
Anna [14]

Answer:

Check the explanation

Explanation:

import java.util.Scanner;

public class Count

{

   public static void main(String[] args)

   {

       // creating array of store to store count of

       //every integer entered

       int[] store = new int[51];

       System.out.println("Enter any integers between"+

       " 0 and 50, and if you are done then enter any"+

       " integer out of the range");

       System.out.println("Enter Integer: ");

       //taking input of first integer

       Scanner scan = new Scanner(System.in);

       int integer = scan.nextInt();

       //looping for integers entered in range

       //to count its occurance

       while(integer >= 0 && integer <= 51)

       {

           //adding count to 'store' array of that

           //particular array of value entered

           store[integer] = store[integer] + 1;

           System.out.println("Enter Integer: ");

           integer = scan.nextInt();

       }

       //printing number of times each integer is entered

       System.out.println("printing number of times"+

           " each integer is entered");

       for (int i=0; i < 51; i++)

       {  

           if (store[i] > 0)

               System.out.println(i + ": " + store[i]);

       }

   }

}

Kindly check the result below

7 0
3 years ago
You've just deployed a new Cisco router that connects several network segments in your organization. The router is physically lo
slamgirl [31]

Answer:

The answer is "Use SCP to back up the router configuration to a remote location".

Explanation:

In the SPC, it is the Secure Copy Protocol that allows information to be stored and securely transmitted. Its SCP doesn't encrypt its digital information by itself; it corresponds to both the Security module which provides authentication or security. It allows the safe transfer of personal documents from either a host machine to a remote server. Its transference protocol "FTP" is quite close, but it adds security and authentication.

4 0
3 years ago
Other questions:
  • ________ is the gathering, organizing, sharing, and analyzing of the data and information to which a business has access.
    6·1 answer
  • Subnetting is accomplished by borrowing bits from the _____ portion of an ip address and reassigning those bits for use as netwo
    13·1 answer
  • 1. Actuators apply mechanical force in the form of pressure to overcome
    10·1 answer
  • What is the purpose of a diode in a cordless drill or power screwdriver?
    14·1 answer
  • Which is the hanging indent on the ruler?
    10·2 answers
  • Sniffer turns the NIC of a system to the promiscuous mode so that it listens to all the data transmitted on its segment. It can
    5·1 answer
  • A sum of money is shared between 2 friends in the ratio 2 : 3. If the larger
    9·1 answer
  • A form of encryption that uses only one key to encrypt and decrypt a file. This is a less
    14·1 answer
  • Dana is moving to a new house. She has 15 boxes for books. Each box can hold up to 22 books. Dana has 375 books. How many more b
    10·2 answers
  • What is a major advantage of medical simulators?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!