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
Electric heater wires are installed in a solid wall having a thickness of 8 cm and k=2.5 W/m.°C. The right face is exposed to an
Svet_ta [14]

Answer:

2.46 * 10⁵ W/m³

Explanation:

See attached pictures for detailed explanation.

6 0
4 years ago
Read 2 more answers
A rigid tank contains 1 kg of oxygen (O2) at p1 = 35 bar, T1 = 180 K. The gas is cooled until the temperature drops to 150 K. De
andreyandreev [35.5K]

Answer:

a. Volume = 13.36 x 10^-3 m³ Pressure = 29.17 bar  b. Volume = 14.06 x 10^-3 m³ Pressure = 22.5 bar

Explanation:

Mass of O₂ = 1kg, Pressure (P1) = 35bar, T1= 180K, T2= 150k Molecular weight of O₂ = 32kg/Kmol

Volume of tank and final pressure using a)Ideal Gas Equation and b) Redlich - Kwong Equation

a. PV=mRT

V = {1 x (8314/32) x 180}/(35 x 10⁵) = 13.36 x 10^-3

Since it is a rigid tank the volume of the tank must remain constant and hnece we can say

T2/T1 = P2/P1, solving for P2

P2 = (150/180) x 35 = 29.17bar

b. P1 = {RT1/(v1-b)} - {a/v1(v1+b)(√T1)}

where R, a and b are constants with the values of, R = 0.08314bar.m³/kmol.K, a = 17.22(m³/kmol)√k, b = 0.02197m³/kmol

solving for v1

35 = {(0.08314 x 180)/(v1 - 0.02197)} - {17.22/(v1)(v1 + 0.02197)(√180)}

35 = {14.96542/(v1-0.02197)} - {1.2835/v1(v1 + 0.02197)}

Using Trial method to find v1

for v1 = 0.5

Right hand side becomes =  {14.96542/(0.5-0.02197)} - {1.2835/0.5(0.5 + 0.02197)} = 31.30 ≠ Left hand side

for v1 = 0.4

Right hand side becomes =  {14.96542/(0.4-0.02197)} - {1.2835/0.4(0.4 + 0.02197)} = 39.58 ≠ Left hand side

for v1 = 0.45

Right hand side becomes =  {14.96542/(0.45-0.02197)} - {1.2835/0.45(0.45 + 0.02197)} = 34.96 ≅ 35

Specific Volume = 35 m³/kmol

V = m x Vspecific/M = (1 x 0.45)/32 = 14.06 x 10^-3 m³

For Pressure P2, we know that v2= v1

P2 = {RT2/(v2-b)} - {a/v2(v2+b)(√T2)} = {(0.08314 x 150)/(0.45 - 0.02197)} - {17.22/(0.45)(0.45 + 0.02197)(√150)} = 22.5 bar

3 0
3 years ago
Help please if you don't know don't give wrong answer please​
mrs_skeptik [129]

4.75cm * 5.22cm is 24.795cm²

but let's do this with m² instead:

0.0475m * 0.0522m = 0.0024795

now we can compare it with the 49780 much easier.

devide. that's the <u>roughly</u> 20,000,000fold of the plot, but it's still squared, so let's take the root

so the representative fraction is 1:4,480.

the exact value is in the screens

have a nice day:)

6 0
3 years ago
For this given problem, if the yield strength is now 45 ksi, using Distortion Energy Theory the material will _______ and using
serious [3.7K]

Answer:

Option A - fail/ not fail

Explanation:

For this given problem, if the yield strength is now 45 ksi, using Distortion Energy Theory the material will _fail______ and using the Maximum Shear Stress Theory the material will ___not fail_______

6 0
3 years ago
Cierto laboratorio está probando una nueva vacuna contra el SARS coV 2 y la 1ra fase incluyesolo 8 voluntarios de tal forma que
madreJ [45]

Answer:

puede que la vacuna no sea segura y se contagien y surga una nueva enfermedad y es lo único que se me ocurre

8 0
2 years ago
Other questions:
  • 1. Consider a city of 10 square kilometers. A macro cellular system design divides the city up into square cells of 1 square kil
    10·1 answer
  • The Ethernet (CSMA/CD) alternates between contention intervals and successful transmissions. Assume a 100 Mbps Ethernet over 1 k
    5·1 answer
  • A preheater involves the use of condensing steam at 100o C on the inside of a bank of tubes to heat air that enters at I atm and
    14·1 answer
  • Assume a steel pipe of inner radius r1= 20 mm and outer radius r2= 25 mm, which is exposed to natural convection at h = 50 W/m2.
    12·1 answer
  • Give me some examples of fragile structures.
    5·1 answer
  • What is the purpose of O-ring and valve seals in a cylinder head?
    15·1 answer
  • Think of an employee object. What are several of the possible states that the object may have over time?
    6·1 answer
  • What are the main microsoft ware packages widely used today​
    6·2 answers
  • A team of engineers is working on a design to increase the power of a hydraulic lever. They have brainstormed several ideas. Whi
    13·1 answer
  • How does science and technology address the problems of the society?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!