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
A typical analog cell phone has a frequency of 850 mhz; a digital phone a frequency of 1950 mhz. compared to the signal from an
Zepler [3.9K]
A higher frequency than the analog cell phone.
5 0
4 years ago
Use the svd() function in matlab to compute a, the rank-1 approximation of a. clearly state what a, is, rounded to 4 decimal pla
PolarNik [594]

Using the knowledge in computational language in C code it is possible to write a code that organizes and calculates the value of the matrix of A*A and that is in up to 4 decimal places.

<h3>Writing the code in C is possible:</h3>

<em>A=[1 2 2;3 4 5;6 7 8];</em>

<em>[u ,s ,v] = svd(A);</em>

<em>k = 1;</em>

<em>A1 = u(:,1:k)*s(1:k,1:k)*v(:,1:k)'; %'</em>

<em>RMSE = rms(sqrt(mean((A - A1).^2)))</em>

See more about C code at brainly.com/question/17544466

#SPJ1

3 0
2 years ago
Determine the best access modifier for each of the following situations: a. A class Employee records the name, address, salary,
Lorico [155]

Answer:

a. Protected

b. Public

Explanation:

There are four acess modifier in Java.

Default: Acessible only within the same package.

Public: Can be acessed by any class.

Private: Acessible only within the class.

For example, you have a class employee and a private method. This method can only be accessed by an object that is an instance of an employee.

Protected: Used in classes that extend each other. For example, a class of employees would extend employee.

So:

a. A class Employee records the name, address, salary, and phone number.

The best acesses modifier is protected. A class may extended employee but have the same arguments(name, adress, salary, phone number), so it should also have acess to the method.

b. An adding method inside of a class BasicMath.

This method can be used in a variety of packages and projects and classes... and there is no important information regarding security. So the best method is public.

4 0
3 years ago
Need the answer ASAP!!! I’ll mark brainliest if correct
san4es73 [151]

Answer:

update standerds

Explanation:

7 0
3 years ago
What are the links between the operating systems, the software, and hardware components in the network, firewall, and IDS that m
LuckyWell [14K]

Answer:

In several organizations, the operating system (OS) functions at the core of the personal computers in use and the servers. The OS ought to be secure from external threats to its stored data and other resources.

Explanation:

In this regard, Intrusion detection systems play a critical role in protecting the sensitive data, along with software firewalls. Hardware firewalls protect the hardware elements in the network (such as storage drivers etc), the IDS and as well as the IPS.

4 0
3 years ago
Other questions:
  • In a word processing program, the ribbon or menus contain the
    12·1 answer
  • ​You work at a call center of a large bank where you answer credit card services related questions from customers. Lately, you h
    14·1 answer
  • Deon is required to provide the citation information for his sources. What type of information should he collect from his source
    10·2 answers
  • Which branch of science helps avoid or minimize stress related injuries at workplace? _____ is a branch of science that aims to
    15·1 answer
  • If a website ends with .gov does it mean that its written by the government or?
    11·2 answers
  • What are two examples of management information systems?
    12·1 answer
  • Mac or PC (need opinions please)<br><br> Why did you choose Mac/PC?
    10·2 answers
  • Diligent people are as concerned with the ____ as the ___ of their work
    12·1 answer
  • Which of the following describes a recording scout's job in the music industry?
    5·2 answers
  • WILL GIVE BRAINLIEST!!!!!! 10 POINTS!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!