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
A thick steel slab ( 7800 kg/m3, 480 J/kg·K, 50 W/m·K) is initially at 300°C and is cooled by water jets impinging on one of its
AleksandrR [38]

Answer: 67.392s

Explanation: detailed calculation is shown below

4 0
3 years ago
Read 2 more answers
How would an engineer know if a product design were feasible?
Masteriza [31]
- the last one ‘design meets all the criteria...’
8 0
4 years ago
Read 2 more answers
An inductor (L = 400 mH), a capacitor (C = 4.43 µF), and a resistor (R = 500 Ω) are connected in series. A 44.0-Hz AC generator
MakcuM [25]

Answer:

(A) Maximum voltage will be equal to 333.194 volt

(B) Current will be leading by an angle 54.70

Explanation:

We have given maximum current in the circuit i_m=385mA=385\times 10^{-3}A=0.385A

Inductance of the inductor L=400mH=400\times 10^{-3}h=0.4H

Capacitance C=4.43\mu F=4.43\times 10^{-3}F

Frequency is given f = 44 Hz

Resistance R = 500 ohm

Inductive reactance will be x_l=\omega L=2\times 3.14\times 44\times 0.4=110.528ohm

Capacitive reactance will be equal to X_C=\frac{1}{\omega C}=\frac{1}{2\times 3.14\times 44\times 4.43\times 10^{-6}}=816.82ohm

Impedance of the circuit will be Z=\sqrt{R^2+(X_C-X_L)^2}=\sqrt{500^2+(816.92-110.52)^2}=865.44ohm

So maximum voltage will be \Delta V_{max}=0.385\times 865.44=333.194volt

(B) Phase difference will be given as \Phi =tan^{-1}\frac{X_C-X_L}{R}=\frac{816.92-110.52}{500}=54.70

So current will be leading by an angle 54.70

5 0
3 years ago
For a body moving with simple harmonic motion state the equations to represent: i) Velocity ii) Acceleration iii) Periodic Time
max2010maxim [7]

Answer with Explanation:

The general equation of simple harmonic motion is

x(t)=Asin(\omega t+\phi)

where,

A is the amplitude of motion

\omega is the angular frequency of the motion

\phi is known as initial phase

part 1)

Now by definition of velocity we have

v=\frac{dx}{dt}\\\\\therefore v(t)=\frac{d}{dt}(Asin(\omega t+\phi )\\\\v(t)=A\omega cos(\omega t+\phi )

part 2)

Now by definition of acceleration we have

a=\frac{dv}{dt}\\\\\therefore a(t)=\frac{d}{dt}(A\omega cos(\omega t+\phi )\\\\a(t)=-A\omega ^{2}sin(\omega t+\phi )

part 3)

The angular frequency is related to Time period 'T' asT =\frac{2\pi }{\omega }

where

\omega is the angular frequency of the motion of the particle.

Part 4) The acceleration and velocities are plotted below

since the maximum value that the sin(x) and cos(x) can achieve in their respective domains equals 1 thus the maximum value of acceleration and velocity is A\omega ^{2} and A\omega respectively.

4 0
3 years ago
A 36 ft simply supported beam is loaded with concentrated loads 16 ft inwards from each support. On the left side, the dead load
lana66690 [7]

Answer:

1st part: Section W18X76  is adequate

2nd part: Section W21X62 is adequate

Explanation:

See the attached file for the calculation

8 0
3 years ago
Other questions:
  • The small washer is sliding down the cord OA. When it is at the midpoint, its speed is 28 m/s and its acceleration is 7 m/s 2 .
    13·1 answer
  • how to calculate the torque when a force is applied on a cog? explain the step-by-step and provide an illustration/diagram. Can
    15·1 answer
  • Assuming the torsional yield strength of a compression spring is 0.43Sut and the maximum shear stress is equal to 434MPa. What i
    9·1 answer
  • A completely mixed activated-sludge process is being designed for a wastewater flow of 10,000 m3/d (2.64 mgd) using the kinetics
    6·1 answer
  • Air at 7 deg Celcius enters a turbojet engine at a rate of 16 kg/s and at a velocity of 300 m/s (relative to engine). Air is hea
    7·1 answer
  • A refrigerator operates on average for 10.0 hours an day. If the power rating is the refrigerator is 709 w how much electrical e
    13·1 answer
  • Who does each person work for? Monica works for a power company, Travis works for a utilities company, and Maggie is self-employ
    15·2 answers
  • Use pseudocode. 1) Prompt for and input a saleswoman's sales for the month (in dollars) and her commission rate (percentage). Ou
    6·1 answer
  • Technician A says that to depressurize high-pressure components of the electronic brake control (EBC) system, research the proce
    13·1 answer
  • HELP _7. All of the following except which would lead to an INCREASE in friction?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!