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
posledela
3 years ago
10

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.
Engineering
1 answer:
pychu [463]3 years ago
3 0

Answer:

def filter_only_certain_strings(data_list):

   new_list = []

   for data in data_list:

       # fix here. change >= to >  

       # because we want to return strings longer than 5 characters in length.

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

           new_list.append(data)

   return new_list

Explanation:

def filter_only_certain_strings(data_list):

   new_list = []

   for data in data_list:

       # fix here. change >= to >  

       # because we want to return strings longer than 5 characters in length.

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

           new_list.append(data)

   return new_list

You might be interested in
Line(s) indicates passing is allowed if there are no oncoming cars.
anygoal [31]
Broken yellow b/c you can’t pass on a double solid yellow
5 0
3 years ago
A new 1.2-ha suburban residential development is to be drained by a storm sewer that connects to the municipal drainage system.
valentinak56 [21]

Answer:

Time of concentration, t_d ⇒ 1280 min

Peak runoff rate, Q_p ⇒4.185 ff³/s

Explanation:

See detailed explanation

6 0
3 years ago
Two small balls A and B with masses 2m and m respectively are released from rest at a height h above the ground. Neglecting air
statuscvo [17]

Answer:

The kinetic energy of A is twice the kinetic energy of B

Explanation:

5 0
3 years ago
For a turning operation, you have selected a high-speed steel (HSS) tool and turning a hot rolled free machining steel. Your dep
Alisiya [41]

Answer:

MRR = 1.984

Explanation:

Given that                              

Depth of cut ,d=0.105 in

Diameter D= 1 in

Speed V= 105 sfpm

feed f= 0.015 ipr

Now  the metal   removal  rate   given as

MRR= 12 f V d

d= depth of cut

V= Speed

f=Feed

MRR= Metal removal rate

By putting the values

MRR= 12 f V d

MRR = 12 x 0.015 x 105 x 0.105

MRR = 1.984

Therefore answer is -

1.944

8 0
3 years ago
Which of the following is a variable expense for many adults?
sertanlavr [38]
But where are the options?
7 0
2 years ago
Read 2 more answers
Other questions:
  • An aluminum cylinder bar ( 70 GPa E m = ) is instrumented with strain gauges and is subject to a tensile force of 5 kN. The diam
    9·1 answer
  • Design a PLC ladder logic program to control the operation of a conveyor-storage system using the following sequence: - 1. Progr
    5·1 answer
  • Experimental Design Application Production engineers wish to find the optimal process for etching circuit boards quickly. They c
    10·1 answer
  • A 2-m3 rigid tank initially contains air at 100 kPa and 22°C. The tank is connected to a supply line through a valve. Air is flo
    14·1 answer
  • 5b. The object George is examining has a mass of 15 grams. What is<br> the density of the object?
    5·1 answer
  • Problem 2. The length of a side of the square block is 4 in. Under the application of the load V, the top edge of the block disp
    6·1 answer
  • प्रहार का समरूपी भिन्नार्थक शब्द अर्थ के साथ ​
    10·1 answer
  • Please help ASAP!!
    10·2 answers
  • What is the difference between a natural and artificial diamond ​
    6·2 answers
  • Let be a real-valued signal for which when . Amplitude modulation is preformed to produce the signal . A proposed demodulation t
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!