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 heat pump cycle is used to maintain the interior of a building at 15°C. At steady state, the heat pump receives energy by heat
Hoochie [10]

Answer:

a) Ql=33120000 kJ

b) COP = 5.6

c) COPreversible= 29.3

Explanation:

a) of the attached figure we have:

HP is heat pump, W is the work supplied, Th is the higher temperature, Tl is the low temperature, Ql is heat supplied and Qh is the heat rejected. The worj is:

W=Qh-Ql

Ql=Qh-W

where W=2000 kWh

Qh=120000 kJ/h

Q_{l}=14days(\frac{24 h}{1 day})(\frac{120000 kJ}{1 h})-2000 kWh(\frac{3600 s}{1 h})=33120000 kJ

b) The coefficient of performance is:

COP=\frac{Q_{h} }{W}=\frac{120000 kJ/h*14(\frac{24 h}{1 day}) }{2000 kWh(\frac{3600 s}{1 h}) } = 5.6

c) The coefficient of performance of a reversible heat pump is:

COP_{reversible}=\frac{T_{h} }{T_{h}-T_{l}  }

Th=20+273=293 K

Tl=10+273=283K

Replacing:

COP_{reversible}=\frac{293}{293-283}=29.3

4 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
How do Consumers sometimes interact with a producers?
Vika [28.1K]
I really don’t know good luck
7 0
3 years ago
Steam at 40 bar and 500o C enters the first-stage turbine with a volumetric flow rate of 90 m3 /min. Steam exits the turbine at
a_sh-v [17]

Answer:

(a) 62460 kg/hr

(b) 17,572.95 kW

(c) 3,814.57 kW

Explanation:

Volumetric flow rate, G = 30 m³ / 1 min => 90 / 60 => 1.5

Calculate for h₁ , h₂ , h₃

h₁ is h at P = 40 bar, 500°C => 3445.84 KJ/Kg

Specific volume steam, ц = 0.086441 m³kg⁻¹

h₂ is h at P = 20 bar, 400°C => 3248.23 KJ/Kg

h₃ is h at P = 20 bar, 500°C => 3468.09 KJ/Kg

h₄ is hg at P = 0.6 bar from saturated water table => 2652.85 KJ/Kg

a)

Mass flow rate of the steam, m = G / ц

m = 1.5 / 0.086441

m = 17.35 kg/s

mass per hour is m = 62460 kg/hr

b)

Total Power produced by two stages

= m (h₁ - h₂) + m (h₃ - h₁)

= m [(3445.84 - 3248.23) + (3468.09 - 2652.85)]

= m [ 197.61 + 815.24 ]

= 17.35 [1012.85]

= 17,572.95 kW

c)

Rate of heat transfer to the steam through reheater

= m (h₃ - h₂)

= 17.35 x (3468.09 - 3248.23)

= 17.35 x 219.86

= 3,814.57 kW

8 0
3 years ago
The velocity profile for a thin film of a Newtonian fluid that is confined between the plate and a fixed surface is defined by u
zimovet [89]

Answer:

F = 0.0022N

Explanation:

Given:

Surface area (A) = 4,000mm² = 0.004m²

Viscosity = µ = 0.55 N.s/m²

u = (5y-0.5y²) mm/s

Assume y = 4

Computation:

F/A = µ(du/dy)

F = µA(du/dy)

F = µA[(d/dy)(5y-0.5y²)]

F = (0.55)(0.004)[(5-1(4))]

F = 0.0022N

8 0
3 years ago
Other questions:
  • This is a multi-part question. Once an answer is submitted, you will be unable to return to this part As steam is slowly injecte
    15·1 answer
  • A package is thrown down an incline at A with a velocity of 1 m/s. The package slides along the surface ABC to a conveyor belt w
    13·1 answer
  • Create a Python program that will produce the following output:
    7·1 answer
  • Which of the following refers to software designed to alter system files and utilities on a victim’s system with the intention o
    15·1 answer
  • -0-1"<br> -0<br> -20<br> -15<br> -10<br> 0<br> -5
    9·1 answer
  • A solid cylindrical workpiece made of 304 stainless steel is 150 mm in diameter and 100 mm is high. It is reduced in height by 5
    12·1 answer
  • It is an important part of the differential maintenance which purpose is to make smoother the differential operation by lubricat
    10·1 answer
  • What speeds did john j montgomerys gliders reach
    12·1 answer
  • which acpi power state allows a system to start where it left off, but all other components are turned off? sleeping mechanical
    13·1 answer
  • If something is 50fficient, how many joules of wasted energy will there be if 750j of energy is put in?’
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!