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
When the binary code is retrieved from ram and moved to the cpu, this stage is known as
vaieri [72.5K]

This stage is known as fetching.

  • Any operation you do in a computer, it runs a lot of codes inside it, and these codes are in binary.
  • For the operation, the computer accesses the RAM memory to gather information about this process, and moves it to the CPU, in a process named as fetching.
  • Thus, the stage asked in this problem is known as fetching.

A similar problem is given at brainly.com/question/21536104

4 0
3 years ago
Which is a circuit board located behind an LCD screen on a laptop?
mina [271]

Answer:

Inverter is an electronic circuit that is located behind the LCD screen on a laptop.

Explanation:

Inverter is an electronic device that is used to convert DC voltage into AC voltage. This will lead to control the output power that is required to Liquid Crystal display. The Output power is limit up to the requirement of Florescent light that are used in Liquid crystal display to make picture visible.

This Inverter is just behind the LCD in laptop to control the lights on the display of screen.

4 0
3 years ago
Which file format would be appropriate for web graphics​
Eddi Din [679]

Answer:

PNG

Explanation:

PNG files can shrink to incredibly small sizes - especially images that are simple colours, shapes, or text. This makes it the ideal image file type for Web graphics.

4 0
2 years ago
Which of the following statements is not true? Question 16 options: a) SQL is the most popular query language used for interacti
lisov135 [29]

Answer:

The answer to this question is option "d".

Explanation:

In this question option d (A user fills out a form to construct a description of the data desired in a SQL search) is not true. Because SQL stands for Structured Query Language. This is a query language used to communicate with a database and a user fills the form. Which is not possible in the SQL. So the option d is not true.

4 0
3 years ago
Which of the following protocols is used by Web servers to establish communication between a web page and a web browser?
Iteru [2.4K]
HTTP or HTTPS is most likely the answer you are looking for.
6 0
3 years ago
Other questions:
  • Difference between change management n asset management
    11·1 answer
  • A _____ defines what must take place, not how it will be accomplished.​
    12·1 answer
  • Describe the best way to deal with a difficult co-worker?
    13·2 answers
  • A group of computers that are interconnected in order to share information or documents is called what?
    13·1 answer
  • What will result if the following code is used in an HTML file? New Title
    13·2 answers
  • What is the output of:<br><br> print (8 % 4)
    6·1 answer
  • Which option should you choose to change the background of your current slide?
    10·2 answers
  • Which option ensures that items in a text box or table cell will be in the absolute center of that element?
    12·1 answer
  • In _________, the process requests permission to access and modify variables shared with others. a) entry section b) critical se
    14·1 answer
  • question 2 which data link layer protocol defines the process by which lan devices interface with upper network layer protocols?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!