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
allochka39001 [22]
3 years ago
6

The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use

the Filter pattern to filter the list in order to return a new list which contains only strings longer than five characters. The current implementation breaks when it encounters integers in the list. Fix it to return a properly filtered new list.
Computers and Technology
1 answer:
Doss [256]3 years ago
6 0

Answer:

def filter_strings(data_list):

   string_list = []

   for s in data_list:

       if type(s) == str and len(s) > 5:

           string_list.append(s)

   return string_list

Explanation:

Create a function called filter_strings that takes data_list as a parameter

Initialize a new list to hold the strings that are longer than 5 characters

Initialize a for loop that iterates through the data_list

Check the elements if they are string - use type function, and if their length is greater than 5 - use len function. If an element satisfies the both conditions, put it to the string_list

When the loop is done, return the string_list

You might be interested in
Which term describes the distinct number of colors a graphic contains? (1 point)?
laila [671]
Your answer would be "Hue".
4 0
3 years ago
Vocabulary and Bridge Information
motikmotik
Umm
This is to bunch of questions..
6 0
3 years ago
For those that play pc games how do you go outside in The Sims 2?
yanalaym [24]

Answer:

My sister plays a lot of the sims 4 but I do recall she also played the Sims 2 so when she would go outside she would command them to do that.

Explanation:

If this does not work I would suggest you get a video that can explain it better than I possibly would? Considering the Sims 2 was made a while back you would maybe want somebody with a little more experience.

5 0
3 years ago
Read 2 more answers
A que generacion pertenecen los gadgets?
alukav5142 [94]

Answer:

English please

Explanation:

8 0
3 years ago
Describe the object-oriented software engineering approach.
Jobisdone [24]

Answer:

 The object oriented software engineering approach is basically focus on the attention for capture the given structure and conduct the data frameworks in the form of small module which consolidates the information and the procedure.

The principle and aim of the Object Oriented Design (OOD) is that improving the quality of the system analysis and increase its productivity and more usable efficiently.

There are different phases in the object oriented software engineering approach are as follows:

  • Firstly, we start analyze and define the particular system
  • Then, construct the analysis model based on the above approach of the specific system.
  • We verify the correctness of the system by using the testing.

3 0
4 years ago
Other questions:
  • The document asks about dependents because the number can
    12·2 answers
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    7·1 answer
  • How long does it take to be placed in a class on flvs?
    14·1 answer
  • A computer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a ser
    9·1 answer
  • Subscript numbering always starts at what value?
    14·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • NEED HELP FAST timed
    13·1 answer
  • Each symbol of an octal number corresponds to 3 bits of a binary number. is it true or false​
    5·1 answer
  • Multiple choice:
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!