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
Historia da inteligencia artificial
choli [55]

Answer:

hshdhwvevwuwijwvww

Explanation:

wwgwvisgwgqiwieoiw

5 0
2 years ago
Read 2 more answers
A set of connected ideas supported by examples is ?
andrezito [222]

Answer:

Argument

Explanation:

<u>Argument</u> - A set of connected ideas, supported by examples, made by a writer to prove or disprove a point.

5 0
3 years ago
Read 2 more answers
Write a program to calculate the
marishachu [46]

Answer:

blep blep blep belp belp belp belp belp belp BELPPPPPPPPPP

5 0
3 years ago
The keywords used in programming languages that use decisions to redirect the flow of a program are called ________. A.flowchart
Zina [86]

Answer:

Option B is the correct answer for the above question.

Explanation:

The control structure is a decision type structure which can be either true or false. It has two options-- If this then, does this otherwise do this. When the user wants to write he control structure then he can do this by the help of the following syntax in python language--

if(condition):

do this

else:

do this

The above question wants to ask about the concept which is used in the programming for a decision then the answer is control structure which is referred from the option B. Hence B is the correct option while the other is not because--

  • Option A states about the flowchart which is the picture form of the instruction.
  • Option C states about the pseudocode which is the language form of the instruction.
  • The operator is also not the correct option because it is used to perform the operation.

6 0
3 years ago
What are the letter that go under each note?
gladu [14]

Answer:

A, B, C, D, E, F, G pls mark me brainliest see explanation below

Explanation:

those are the letters if you search up letters for music you can find them way easier than me explaining and you will also learn faster. please mark me brainliest

5 0
2 years ago
Read 2 more answers
Other questions:
  • If a database named Contacts has a table named tblEmployees and another database named Orders links to that tblEmployees table,
    8·1 answer
  • Consider a set of mobile computing clients in a certain town who each
    13·1 answer
  • Generally speaking, mobile sites are good for acquiring new customers and inspiring new relationships while mobile apps are good
    6·1 answer
  • Point: A Point in a two dimensional plane has an integer x coordinate value and an integer y coordinate value.
    12·1 answer
  • A disadvantage of using an arithmetic mean to summarize a set of data is that __________.
    13·1 answer
  • Leah wants to add an image to her updated presentation, so she wants to access the Help interface. What should
    11·2 answers
  • The Internet began when a large company wanted to sell products online.
    11·2 answers
  • Arrays of structures ________. Group of answer choices None of the above. are automatically passed by reference cannot be passed
    6·1 answer
  • Consider our authentication protocol 4.0, in which Alice authenticates herself to Bob, which we saw works well (i.e., we found n
    15·1 answer
  • What should you do when you are working on an unclassified system and receive an email.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!