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
slavikrds [6]
3 years ago
14

The function below takes a single parameter, a list of numbers called number_list. Complete the function to return a string of t

he provided numbers as a series of comma separate values (CSV). For example, if the function was provided the argument [22, 33, 44], the function should return '22,33,44'. Hint: in order to use the join function you need to first convert the numbers into strings, which you can do by looping over the number list to create a new list (via append) of strings of each number.
Engineering
1 answer:
makkiz [27]3 years ago
6 0

Answer:

The solution code is written in Python:

  1. def convertCSV(number_list):
  2.    str_list = []
  3.    for num in number_list:
  4.        str_list.append(str(num))
  5.    
  6.    return ",".join(str_list)
  7. result = convertCSV([22,33,44])
  8. print(result)

Explanation:

Firstly, create a function "convertCSV" with one parameter "number_list". (Line 1)

Next, create an empty list and assign it to a new variable <em>str_list</em>. (Line 2)

Use for-loop to iterate through all the number in the <em>number_list</em>.(Line 4). Within the loop, each number is converted to a string using the Python built-in function <em>str() </em>and then use the list append method to add the string version of the number to <em>str_list</em>.

Use Python string<em> join() </em>method to join all the elements in the str_list as a single string. The "," is used as a separator between the elements (Line 7) . At the end return the string as an output.

We can test the function by calling the function and passing [22,33,34] as an argument and we shall see "22,33,44" is printed as an output. (Line 9 - 10)

You might be interested in
According to fire regulations in a town, the pressure drop in a commercial steel, horizontal pipe must not exceed 2.0 psi per 25
bonufazy [111]

Answer:

6.37 inch

Explanation:

Thinking process:

We need to know the flow rate of the fluid through the cross sectional pipe. Let this rate be denoted by Q.

To determine the pressure drop in the pipe:

Using the Bernoulli equation for mass conservation:

\frac{P1}{\rho } + \frac{v_{2} }{2g} +z_{1}  = \frac{P2}{\rho } + \frac{v2^{2} }{2g} + z_{2} + f\frac{l}{D} \frac{v^{2} }{2g}

thus

\frac{P1-P2}{\rho }  = f\frac{l}{D} \frac{v^{2} }{2g}

The largest pressure drop (P1-P2) will occur with the largest f, which occurs with the smallest Reynolds number, Re or the largest V.

Since the viscosity of the water increases with temperature decrease, we consider coldest case at T = 50⁰F

from the tables

Re= 2.01 × 10⁵

Hence, f = 0.018

Therefore, pressure drop, (P1-P2)/p = 2.70 ft

This occurs at ae presure change of 1.17 psi

Correlating with the chart, we find that the diameter will be D= 0.513

                                                                                                      = <u>6.37 in Ans</u>

7 0
3 years ago
The Torricelli's theorem states that the (velocity—pressure-density) of liquid flowing out of an orifice is proportional to the
Sergeeva-Olga [200]

Answer:

The correct answer is 'velocity'of liquid flowing out of an orifice is proportional to the square root of the 'height'  of liquid above the center of the orifice.

Explanation:

Torricelli's theorem states that

v_{exit}=\sqrt{2gh}

where

v_{exit} is the velocity with which the fluid leaves orifice

h is the head under which the flow occurs.

Thus we can compare the given options to arrive at the correct answer

Velocity is proportional to square root of head under which the flow occurs.

4 0
3 years ago
The electron concentration in silicon at T = 300 K is given by
puteri [66]

Answer:

E=1.44*10^-7-2.6exp(\frac{-x}{18} )v/m

Explanation:

From the question we are told that:

Temperature of silicon T=300k

Electron concentration n(x)=10^{16}\exp (\frac{-x}{18})

                                        \frac{dn}{dx}=(10^{16} *(\frac{-1}{16})\exp\frac{-x}{16})

Electron diffusion coefficient is Dn = 25cm^2/s \approx 2.5*10^{-3}

Electron mobility is \mu n = 960 cm^2/V-s \approx0.096m/V

Electron current density Jn = -40 A/cm^2 \approx -40*10^{4}A/m^2

Generally the equation for the semiconductor is mathematically given by

Jn=qb_n\frac{dn}{dx}+nq \mu E

Therefore

-40*10^{4}=1.6*10^{-19} *(2.5*10^{-3})*(10^{16} *(\frac{-1}{16})\exp\frac{-x}{16})+(10^{16}\exp (\frac{-x}{18}))*1.6*10^{-19}*0.096* E

E=\frac{-2.5*10^-^7 exp(\frac{-x}{18})+40*10^{4}}{1.536*10^-4exp(\frac{-x}{18} )}

E=1.44*10^-7-2.6exp(\frac{-x}{18} )v/m

7 0
2 years ago
Q4. (20 points) For a bronze alloy, the stress at which plastic deformation begins is 271 MPa and the modulus of elasticity is 1
babunello [35]

Answer:

a) P = 86720 N

b) L = 131.2983 mm

Explanation:

σ = 271 MPa = 271*10⁶ Pa

E = 119 GPa = 119*10⁹ Pa

A = 320 mm² = (320 mm²)(1 m² / 10⁶ mm²) = 3.2*10⁻⁴ m²

a) P = ?

We can apply the equation

σ = P / A     ⇒    P = σ*A = (271*10⁶ Pa)(3.2*10⁻⁴ m²) = 86720 N

b) L₀ = 131 mm = 0.131 m

We can get ΔL applying the following formula (Hooke's Law):

ΔL = (P*L₀) / (A*E)    ⇒  ΔL = (86720 N*0.131 m) / (3.2*10⁻⁴ m²*119*10⁹ Pa)

⇒  ΔL = 2.9832*10⁻⁴ m = 0.2983 mm

Finally we obtain

L = L₀ + ΔL = 131 mm + 0.2983 mm = 131.2983 mm

3 0
3 years ago
Preheat and postheating are necessary when welding gray cast iron. *<br> True<br> False
Zepler [3.9K]
True will be your answer have a great day
5 0
2 years ago
Other questions:
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    13·1 answer
  • Both carpenters and building inspectors have been associated with the personality characteristics identified as realistic, conve
    12·1 answer
  • A plane wall, 7.5 cm thick, generates heat internally at the rate of 105W/m3. One side of the wall is insulated and the other si
    14·1 answer
  • Yes I’m very cool I promise.
    15·1 answer
  • Match the terms with the correct definitions.
    14·1 answer
  • Which of the following characteristics would not give animals an advantage in the ocean?
    13·1 answer
  • (a) A non-cold-worked 1040 steel cylindrical rod has an initial length of 100 mm and initial diameter of 7.50 mm. is to be defor
    7·1 answer
  • How does energy transition from one form to another as water moves from behind a dam to downstream of a dam?.
    8·1 answer
  • How many hours should I charge a 4.8 volt 600mah battery(it is urgent)
    8·1 answer
  • Precast concrete curtain wall panels: Group of answer choices are typically manufactured on site and then hoisted into place. of
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!