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
Water at 200C flows through a pipe of 10 mm diameter pipe at 1 m/s. Is the flow Turbulent ? a. Yes b. No
Degger [83]

Answer:

Yes, the flow is turbulent.

Explanation:

Reynolds number gives the nature of flow. If he Reynolds number is less than 2000 then the flow is laminar else turbulent.

Given:

Diameter of pipe is 10mm.

Velocity of the pipe is 1m/s.

Temperature of water is 200°C.

The kinematic viscosity at temperature 200°C is 1.557\times10^{-7}m2/s.

Calculation:

Step1

Expression for Reynolds number is given as follows:

Re=\frac{vd}{\nu}

Here, v is velocity, \nu is kinematic viscosity, d is diameter and Re is Reynolds number.

Substitute the values in the above equation as follows:

Re=\frac{vd}{\nu}

Re=\frac{1\times(10mm)(\frac{1m}{1000mm})}{1.557\times10^{-7}}

Re=64226.07579

Thus, the Reynolds number is 64226.07579. This is greater than 2000.

Hence, the given flow is turbulent flow.

5 0
3 years ago
Q5
Klio2033 [76]

The C++ code that would draw all the iterations in the selection sort process on the array is given below:

<h3>C++ Code</h3>

#include <stdio.h>

#include <stdlib.h>

int main() {

   int i, temp1, temp2;

   int string2[16] = { 0, 4, 2, 5, 1, 5, 6, 2, 6, 89, 21, 32, 31, 5, 32, 12 };

   _Bool check = 1;

   while (check) {

       temp1 = string2[i];

       temp2 = string2[i + 1];

       if (temp1 < temp2) {

           string2[i + 1] = temp1;

           string2[i] = temp2;

           i = 0;

       } else {

           i++;

           if (i = 15) {

               check = !check;

           }

       }

   }

   

   return 0;

}

Read more about C++ programming here:

brainly.com/question/20339175

#SPJ1

5 0
1 year ago
Oil of density 780 kg/m3 is flowing at a velocity of 20 m/s at the atmospheric pressure in a horizontal cylindrical tube elevate
Soloha48 [4]

Answer:

radius = 0.045 m

Explanation:

Given data:

density of oil = 780 kg/m^3

velocity = 20 m/s

height = 25 m

Total energy is = 57.5 kW

we have now

E = kinetic energy+ potential energy +  flow work

E = \dot m ( \frac{v^2}{2] +  zg + p\nu)

E = \dot m( \frac{v^2}{2] +  zg + p_{atm} \frac{1}{\rho})

57.5 \times 10^3 = \dot m ( \frac{20^2}{2} + 25 \times 9.81 + 101325 \frac{1}{780})

solving for flow rate

\dot m = 99.977we know that [tex]\dot m  = \rho AV

\dot m  = 780 \frac{\pi}{4} D^2\times 16

solving for d

99.97 = 780 \times \frac{\pi}{4} D^2\times 16

d = 0.090 m

so radius = 0.045 m

3 0
3 years ago
To reduce the negative impacts of stress on your mental
soldi70 [24.7K]

Answer:

A&C

Explanation:

breathing deeply is relaxing

talking with a friend can helping

4 0
3 years ago
Read 2 more answers
A consulting firm submitted a bid for a large research project. The firm's management initially felt there was a 50/50 chance of
klemol [59]

Answer:

1. 0.50

2. 0.75

3. 0.65

Explanation:

1. For the bid being successful with a 50-50 chance, we have the probability:

50/(50 + 50) = 50 / 100 = 0.50

2. Given the request for additional info:

Probability = probability of request and successful / probability of successful

= 75 / 100 = 0.75

3. We will evaluate the probability of being successful given its request

We will use the Bayesian theorem

= [P(request | successful) * P(successful)] / [P(request | successful) * P(successful) + P(request | unsuccessful) * P(unsuccessful)]

= ( 0.75 * 0.5) / (0.75 * 0.5 + 0.4 * 0.5)

= 0.65

6 0
3 years ago
Other questions:
  • A rod is 2m long at temperature of 10oC. Find the expansion of the rod, when the temperature is raised to 80oC. If this expansio
    7·1 answer
  • A rectangular channel 6 m wide with a depth of flow of 3m has a mean velocity of 1.5 m/sec. The channel undergoes a smooth, grad
    7·1 answer
  • Which phrase best describes a safety-critical system? A. a system that faces a very high risk of failure B. a system isolated fr
    13·1 answer
  • Drag each tile to the correct box.
    15·1 answer
  • python Write a program that asks a user to type in two strings and that prints •the characters that occur in both strings. •the
    6·1 answer
  • A 150-lbm astronaut took his bathroom scale (aspring scale) and a beam scale (compares masses) to themoon where the local gravit
    9·1 answer
  • A growing trend in urban design is the concept of a rooftop garden. If every building in a city were to install a rooftop garden
    13·1 answer
  • Why charles babbage is known as father of computer explain <br>​
    12·1 answer
  • Technician A says that the starter solenoid switches the high current on and off. Technician B says that the solenoid on the sta
    5·1 answer
  • Almost all collisions are due to driver error
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!