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
Technician A says that 5W-30 would be better to use than 20W-50 in most vehicles in
shtirl [24]
Technician is correct sorry if im wronghg
5 0
3 years ago
Read 2 more answers
To revise a monthly budget, changes in which categories might need to be addressed? Check all that apply.
GREYUIT [131]

Income

amount budgeted

expenses

5 0
2 years ago
Why is flexibility the most obvious benefit of road transportation select all that apply
ser-zykov [4K]
What am I going to select?? What are my choices bro????
7 0
3 years ago
Using the state mileage guide table located on the top of each map page you can
Ivenika [448]
C. Route and roadways defined as class I highways
5 0
3 years ago
Horizontal shear forces and, consequently, horizontal shear stresses are caused in a flexural member at those locations where th
jek_recluse [69]

Answer:

False

Explanation:

When the horizontal shear forces act on the surface there is transverse shear stress at a particular point which is equal in magnitude. Pure bending is less common than a non uniform bending because the beam is not in equilibrium.

5 0
3 years ago
Other questions:
  • What does the following program segment do? Declare Count As Integer Declare Sum As Integer Set Sum = 0 For (Count = 1; Count &l
    15·1 answer
  • Consider the expansion of a gas at a constant temperature in a water-cooled piston-cylinder system. The constant temperature is
    13·1 answer
  • What material resources and intellectual resources were used in self driving cars?
    15·1 answer
  • [4 points] Does the green LED emit light when you connect the banana plug wires across it? What does that say about the threshol
    13·1 answer
  • Why do engineers (and others) use the design process?
    13·1 answer
  • The conditions at the beginning of compression in an Otto engine operating on hot-air standard with k=1.35 and 101.325 kPa, 0.05
    10·1 answer
  • Which of the following sentences uses the word malleable correctly?
    7·2 answers
  • How is the air delivery temperature controlled during A/C operation?
    8·1 answer
  • Code for XOR with two input logic gate
    8·1 answer
  • When you hover over an edge or point, you are activating ____________ in SketchUp?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!