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
What is the mass of a brass axle that has a volume of 0.318 cm? ​
NeX [460]

Answer:

2.7g

Explanation:

the mass of a brass axle that has a volume of 0.318 cm is 2.7g.

8 0
3 years ago
In a steady flow device, the properties of the system remains constant with time. a)True b) False
Leviafan [203]

Answer:

True

Explanation:

By definition of steady flow we have

\frac{\partial f(x,y,z,t) }{\partial t}=0

where f(x,y,z,t) is any property of the system under consideration

=> f(x,y,z,t) = constant

7 0
3 years ago
Question #8
iris [78.8K]

Problem solving is the act of orderly searching for solutions to problem

The correct option that involves approaching a problem in a new way is the option;

Creative thinking

The reasons why creative thinking is the correct option is given as follows;

Finding new ways to approach a problem, involves considering alternatives to already known approaches to the problem

Given that the options to be considered are to be options which have not been applied, then the process does not involve;

Context: Which looks at the variables that relate the problem with setting or circumstance that aid understanding of the problem

Critical thinking; Which is based on the analysis of the known facts, but the new proposals are required

Perseverance; Which involves adherence to a particular option despite delay or difficulty

However;

Creative thinking; Creative thinking involves the consideration of a situation thing or problem in a new way or by approaching a task differently than what was considered a regular approach, which involves finding an unused or imaginative approach to a problem

Therefore;

The option that involves finding new ways to approach a problem is <u>creative thinking</u>

<u />

Learn lore about problem solving here:

brainly.com/question/24528689

3 0
2 years ago
Six housing subdivisions within a city area are target for emergency service by a centralized fire station. Where should the new
Marina86 [1]

Answer:

Explanation:

Since there are six points, the minimum distance from all points would be the centroid of polygon formed by A,B,C,D,E,F

To find the coordinates of centroid of a polygon we use the following formula. Let A be area of the polygon.

C_{x}=\frac{1}{6A} sum(({x_{i} +x_{i+1})(x_{i}y_{i+1}-x_{i+1}y_{i}))     where i=1 to N-1 and N=6

C_{y}=\frac{1}{6A} sum(({y_{i} +y_{i+1})(x_{i}y_{i+1}-x_{i+1}y_{i}))

A area of the polygon can be found by the following formulaA=\frac{1}{2} sum(x_{i} y_{i+1} -x_{i+1} y_{i}) where i=1 to N-1

A=\frac{1}{2}[ (x_{1}  y_{2} -x_{2}  y_{1})+ (x_{2}  y_{3} -x_{3}  y_{2})+(x_{3}  y_{4} -x_{4}  y_{3})+(x_{4}  y_{5} -x_{5}  y_{4})+(x_{5}  y_{6} -x_{6}  y_{5})]

A=0.5[(20×25 -25×15) +(25×32 -13×25)+(13×21 -4×32)+(4×8 -18×21)+(18×14 -25×8)

A=225.5 miles²

Now putting the value of area in Cx and Cy

C_{x} =\frac{1}{6A}[ [(x_{1}+x_{2})(x_{1}  y_{2} -x_{2}  y_{1})]+ [(x_{2}+x_{3})(x_{2}  y_{3} -x_{3}  y_{2})]+[(x_{3}+x_{4})(x_{3}  y_{4} -x_{4}  y_{3})]+[(x_{4}+x_{5})(x_{4}  y_{5} -x_{5}  y_{4})]+[(x_{5}+x_{6})(x_{5}  y_{6} -x_{6}  y_{5})]]

putting the values of x's and y's you will get

C_{x} =15.36

For Cy

C_{y} =\frac{1}{6A}[ [(y_{1}+y_{2})(x_{1}  y_{2} -x_{2}  y_{1})]+ [(y_{2}+y_{3})(x_{2}  y_{3} -x_{3}  y_{2})]+[(y_{3}+y_{4})(x_{3}  y_{4} -x_{4}  y_{3})]+[(y_{4}+y_{5})(x_{4}  y_{5} -x_{5}  y_{4})]+[(y_{5}+y_{6})(x_{5}  y_{6} -x_{6}  y_{5})]]

putting the values of x's and y's you will get

C_{y} =22.55

So coordinates for the fire station should be (15.36,22.55)

5 0
3 years ago
What is relation of crankshaft and camshaft
Monica [59]
Mierda me dices solo necesito puntos
6 0
3 years ago
Read 2 more answers
Other questions:
  • I am trying to create a line of code to calculate distance between two points. (distance=[tex]\sqrt{ (x2-x1)^2+(y2-y1)^2}) My li
    5·1 answer
  • What are the seven problem solving steps?
    12·1 answer
  • Two points along a wire are labeled Xand Y. The current is measured to be iXY= –3A.The reference direction of iXY is defined by
    11·1 answer
  • A process engineer performed jar tests for a water in order to determine the optimal pH and dose using alum. A test was conducte
    13·1 answer
  • Thermal conductivity of AISI 316 Stainless Steel at 90ºC is 14.54 W/m K. Convert this value to IP system.
    8·1 answer
  • You are an engineer working in a auto crash test lab. Some members of your team have raised objections against the use of cadave
    10·1 answer
  • 5. Identify the pros and cons of<br> manufactured siding.
    12·1 answer
  • Consider a machine of mass 70 kg mounted to ground through an isolation system of total stiffness 30,000 N/m, with a measured da
    9·1 answer
  • Kaya just bought a house and realizes that the chimney needs to be totally torn down and rebuilt. She needs to call an expert si
    6·1 answer
  • 11. As __and___ prices continued to rise in the late 1960’s and 70's, 4 and 6 cylinder engines began to make a comeback.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!