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 well-established way of power generation involves the utilization of geothermal energy-the energy of hot water that exists nat
jeka94

Answer:

the maximum thermal efficiency is 29%

Explanation:

the maximum efficiency for a thermal engine that works between a cold source and a hot source is the one of a Carnot engine. Its efficiency is given by

Maximum efficiency= 1 - T2/T1

where

T2= absolute temperature of the cold sink (environment)= 20°C + 273 = 293

T2= absolute temperature of the hot source (hot water supply) = 140°C + 273 = 413

therefore

Maximum efficiency= 1 - T2/T1 = 1 - 293/413 = 0,29 =29%

3 0
3 years ago
A computer maintenance company wants to 'capture' the knowledge that employees carry around in their heads by creating a databas
galina1969 [7]

Answer: The answer is A. The company is trying to transfer intellectual capital to a knowledge management system

5 0
3 years ago
(a) Draw the Moore finite state machine (FSM) of an electronic combination lock with a RESET button, two number buttons (0 and 1
Dafna11 [192]

Answer:

Explanation:

There are a total of 6 states and 3 bits in this problem. Whenever the Reset button is pressed, RESET state is called otherwise the state according to the diagram is called. For the combination to be "01011", the input sequence has to be in the same order. If 0 is pressed instead of 1 in state "010", the last state of output ending with 0 will be called and likewise in all the states that follow.

7 0
3 years ago
Answer true or false 3.Individual people decide what will be produced in a command<br> oconomy
Pie

Answer:

False

Explanation:

The government decides the productions.

7 0
3 years ago
Read 2 more answers
The author states that chemical engineering is one of the most difficult and complex aspects of engineering. Why do you think th
marishachu [46]

Answer:

hope this helps

Explanation:

answers:

1. Chemical engineering is most difficult because it's a mix of physics, chemistry and math

2. Stoichiometry is so important because it shows how materials react, interact and play off each other

3. Yes I think consumers would notice if process control standards were not met. for example medicines, when people take Tylenol or cold pills, if the amount of time it took to kick it becomes longer, people will become aware that the product is not consistent and reliable.

4. i have no idea sorry :(

5. This is explaining how there are rules and regulations to make the workplace safe. it can be accomplished by following those rules and regulations

8 0
3 years ago
Read 2 more answers
Other questions:
  • A corroded metal gusset plate was found on a bridge. It was estimated that the original area of the plate was 750 cm2 and that a
    11·1 answer
  • Using Von Karman momentum integral equation, find the boundary layer thickness, the displacement thickness, the momentum thickne
    14·1 answer
  • 1. True or False: When two batteries are wired in Series the Volts go up and the Amp Hours stay the same. 2. True or False: When
    6·1 answer
  • WILL BRAINLIEST IF CORRECT!!!!!<br><br> Some one help ASAP.
    8·1 answer
  • Demonstreaza in 20 de propoziti ca snoava pacala si zarzarele boerului e o snoava
    12·1 answer
  • How long does it take to get a master's degree in Mechanical engineering?
    12·1 answer
  • The alternator must be operated with the battery disconnected or with the terminals at the back of the alternator
    15·2 answers
  • PLEASE HELP WITH THIS ASAP! Thanks
    6·1 answer
  • Which material has the highest cp value?
    10·1 answer
  • Drivers education :Anything that draws your mind off driving is
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!