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
Rom4ik [11]
3 years ago
14

Question 29: Returns a string based on input string The function below takes a single string parameter: input_string. If the inp

ut contains the lowercase letter z, return the string 'has the letter z'. Otherwise, return the string 'not worthwhile'. contain.py 1. def string contains(input_string): Que Best s Availat Awarde Restore original file Save & Grade Save only Atta No attach Attacha Attache
Engineering
1 answer:
kirill [66]3 years ago
8 0

Answer:

Two Python codes are explained for the problem. Modify as appropriate

Explanation:

<u>CODE 1:</u>

def string_contains(input_string): # called function

if(input_string.__contains__('z')): # Check input_string contains 'z'

print('has the letter z.') # print input_string contains 'z'

else:

print('not worthwhile.') # print if input_string not contains 'z'

input_string = input('Please enter the string: ') # ACeept string from user

string_contains(input_string) # calling function where we pass input_string as actual parameter

<u>CODE 2:</u>

def string_contains(input_string):

   for x in input_string:

       if x=='z':

           return 'has the letter z'

   return 'not worthwhile'

You might be interested in
What is the magnitude of the maximum stress that exist at the tip of an internal crack having a radius of curvature of 1.9 x 10-
Hitman42 [59]

Answer:

2800 [MPa]

Explanation:

In fracture mechanics, whenever a crack has the shape of a hole, and the stress is perpendicular to the orientation of such, we can use a simple formula to calculate the maximum stress at the crack tip

\sigma_{m} = 2 \sigma_{p} (\frac{l_{c}}{r_{c}})^{0.5}

Where \sigma_{m} is the magnitude of he maximum stress at the tip of the crack, \sigma_{p} is the magnitude of the tensile stress, l_{c} is 1/2 the length of the internal crack, and r_{c} is the radius of curvature of the crack.

We have:

r_{c}=1.9*10^{-4} [mm]

l_{c}=3.8*10^{-2} [mm]

\sigma_{c}=140 [MPa]

We replace:

\sigma_{m} = 2*(140 [MPa])*(\frac{\frac{3.8*10^{-2} [mm]}{2}}{1.9*10^{-4} [mm]})^{0.5}

We get:

\sigma_{m} = 2*(140 [MPa])*(\frac{\frac{3.8*10^{-2} [mm]}{2}}{1.9*10^{-4} [mm]})^{0.5}=2800 [MPa]

5 0
3 years ago
Explain why the scenario below fails to illustrate an understanding of the importance of metrology. Situation: Natalie is a cali
VMariaS [17]

Answer:

Explanation:

The situation being described completely fails in regard to the importance of metrology. This is because the main importance of metrology is making sure that all of the measurements in a process are as accurate as possible. This accuracy allows an entire process to function efficiently and without errors. In a food production plant, each individual department of the plant relies on the previous function to have completed their job with the correct and accurate instructions so that they can fulfill their functions correctly and end up with a perfect product. If the oven (like in this scenario) is a couple of degrees off it can cause the product to come out burned or undercooked, which will then get transferred to the next part of production which will also fail due to the failed input (burned or undercooked product). This will ultimately lead to an unusable product at the end of the process and money wasted. Which in a large production plant means thousands of products in a single batch are thrown away.

8 0
3 years ago
A certain part of the cast iron piping of a water distribution system involves a parallel section. Both parallel pipes have a di
Bezzdna [24]

Answer :

<h3>Flow rate in pipe B is = 0.3094 \frac{m^{3} }{s}</h3>

Explanation:

Given :

Length of pipe A L_{A}  = 1500 m

Length of pipe B L_{B} = 2500 m

Flow rate through pipe A Q_{A}  = 0.4 \frac{m^{3} }{s}

Diameter of pipe D = 30 \times 10^{-2} m

Velocity from pipe A,

  V _{A} = \frac{Q_{A} }{A}

  V _{A} = \frac{0.4 \times 4 }{\pi ( 30 \times 10^{-2} )^{2}  }

  V_{A}  = 5.66 \frac{m}{s}

Here, head loss is same because height is same.

    h_{a} = h_{b}

L_{A} V_{A} ^{2} = L_{B}  V_{B} ^{2}

V_{B} = \sqrt{\frac{1500}{2500}}    (5.66)

V_{B} = 4.38 \frac{m}{s}

Now rate of flow from pipe B is,

Q_{B}  = V_{B} A

Q_{B}  = \frac{\pi }{4}  (0.3)^{2} \times 4.38

Q_{B} = 0.3094 \frac{m^{3} }{s}

4 0
3 years ago
If you are unsure about holding a piece of wood to be drilled, then you should always use a
alisha [4.7K]
C I took construction class
4 0
3 years ago
Tech A says you can find the typical angle of a V-block engine by dividing the number of cylinders by 720
jeka57 [31]

Answer:

Tech A is correct

Explanation:

Tech A is right as its V- angle is identified by splitting the No by 720 °. Of the piston at the edge of the piston.

Tech B is incorrect, as the V-Angle will be 720/10 = 72 for the V-10 motor, and he says 60 °.

6 0
3 years ago
Other questions:
  • Degreasers can be broken down into two main categories
    9·2 answers
  • 6. Construct a neural network that computes the XOR function of two inputs. Make sure to specify what sort of units you are usin
    7·1 answer
  • 10. What main factors influence the choice of electrical wall<br> boxes?
    6·1 answer
  • heavy ball with a weight of 150 N is hung from the ceiling of a lecture hall on a 4.5-m-long rope. The ball is pulled to one sid
    9·1 answer
  • the employer must comply with an employees or employee representative request to examine and copy abatement documents within
    12·1 answer
  • Consider a two-dimensional incompressible velocity potential phi = ???????? cos theta + ????????theta, where B and L are constan
    8·1 answer
  • Consider a cubic crystal with the lattice constant a. Complete the parts (a)-(c) below. (a) Sketch the crystallographic planes w
    6·1 answer
  • Two different fuels are being considered for a 2.5 MW (net output) heat engine which can operate between the highest temperature
    15·1 answer
  • 6.48 programming project 1: encode/decode tic -tac-toe
    5·1 answer
  • Who do you contact to get your credit report?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!