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
4 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]4 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
(a) For a given material, would you expect the surface energy to be greater than, the same as, or less than the grain boundary e
aksik [14]

Answer:

(a) Surface energy is greater than grain boundary energy due to the fact that the bonds of the atoms on the surface are lower than those of the atoms at the grain boundary. The energy is also directly proportional to the number of bonds created.

(b) The energy of a high-angle grain boundary is higher than that of a small-angle grain boundary because the high-angle grain boundary has a higher misalignment and smaller number of bonds than a small-angle grain boundary.

Explanation:

(a) Surface energy is greater than grain boundary energy due to the fact that the bonds of the atoms on the surface are lower than those of the atoms at the grain boundary. The energy is also directly proportional to the number of bonds created.

(b) The energy of a high-angle grain boundary is higher than that of a small-angle grain boundary because the high-angle grain boundary has a higher misalignment and smaller number of bonds than a small-angle grain boundary.

5 0
3 years ago
Match each context to the type of the law that is most suitable for it.
Bas_tet [7]

Answer:

sorry i dont understand the answer

Explanation:

but i think its a xd jk psml lol

5 0
3 years ago
1. In a base bias configuration with a supply voltage is 15v, what does Ver equal when reverse biased?
wlad13 [49]
The answer is C!!!!!!!!
3 0
3 years ago
BE-40 What is a characteristic of a catamaran hull?
Nat2105 [25]

Answer:

<em>A stable ride</em>

Explanation:

A Catamaran hull is a form of sea craft invented by the Austronesian peoples, the invention of the Catamaran hull enabled these people to sail across the sea in their expansion to the islands of the Indian and Pacific Oceans. Catamaran has multiple hulls, usually two parallel hulls of equal size. This geometric feature gives the craft an increased stability because,<em> it derives extra stability from its wide beam, in the place of a ballasted keel employed in a regular monohull sailboat. </em>A Catamaran hull will require four times the force needed to capsize it, when compared to an equivalent monohull.

8 0
3 years ago
A train starts from rest at station A and accelerates at 0.6 m/s^2 for 60 s. Afterwards it travels with a constant velocity for
Aleks [24]

Answer:

The distance between the station A and B will be:

x_{A-B}=55.620\: km  

Explanation:

Let's find the distance that the train traveled during 60 seconds.

x_{1}=x_{0}+v_{0}t+0.5at^{2}

We know that starts from rest (v(0)=0) and the acceleration is 0.6 m/s², so the distance will be:

x_{1}=\frac{1}{2}(0.6)(60)^{2}

x_{1}=1080\: m

Now, we need to find the distance after 25 min at a constant speed. To get it, we need to find the speed at the end of the first distance.

v_{1}=v_{0}+at

v_{1}=(0.6)(60)=36\: m/s

Then the second distance will be:

x_{2}=v_{1}*1500

x_{2}=(36)(1500)=54000\: m        

The final distance is calculated whit the decelerate value:

v_{f}^{2}=v_{1}^{2}-2ax_{3}

The final velocity is zero because it rests at station B. The initial velocity will be v(1).

0=36^{2}-2(1.2)x_{3}

x_{3}=\frac{36^{2}}{2(1.2)}  

x_{3}=540\: m

Therefore, the distance between the station A and B will be:

x_{A-B}=x_{1}+x_{2}+x_{3}  

x_{A-B}=1080+54000+540=55.620\: km  

I hope it helps you!

 

7 0
3 years ago
Other questions:
  • Select the level of education that is best demonstrated in each example.
    10·2 answers
  • computer language C++ (Connect 4 game)( this is all the info that was givin no input or solution) I used the most recent version
    6·1 answer
  • The 10 foot wide circle quarter gate AB is articulated at A. Determine the contact force between the gate and the smooth surface
    10·1 answer
  • 2. What is an important aspect of the American free enterprise system that encourages people to
    10·2 answers
  • Water is the working fluid in a Rankine cycle. Superheated vapor enters the turbine at 8 MPa, 560°C and the turbine exit pressur
    13·1 answer
  • What are the factors of production in business? Land, labor, and capital land, capital, and interest land, labor, and customer b
    10·2 answers
  • At a certain location, wind is blowing steadily at 5 mph. Suppose that the mass density of air is 0.0796 lbm/ft3 and determine t
    6·1 answer
  • Airplanes typically have a Pitot-static probe located on the underside that measures relative wind speed as the airplane flies.
    6·1 answer
  • Which of the following is a purpose of sports biomechanics?
    14·1 answer
  • I want to solve the question
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!