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
Masja [62]
3 years ago
15

The function below takes a single string parameter: input_string. If the input contains the lowercase letter z, return the strin

g 'has the letter z'. Otherwise, return the string 'not worthwhile'.

Engineering
1 answer:
Whitepunk [10]3 years ago
4 0

Answer:

# string_contains function is defined with input_string

# as arguments

def string_contains(input_string):

   # if-statement that check if letter z is in input_string

   if 'z' in input_string:

       # it print"has the letter z" if it has z

       print("has the letter z")

   else:

       # else it print "not worthwhile"

       print("not worthwhile")

       

# string_contains function is called

string_contains("The animal is zebra")        

string_contains("learning is fun")

Explanation:

The code is written in Python and well commented.

Image of the output when the function is called is attached.

You might be interested in
A private plane pilot is what kind of individual transportation position? professional level mid-level entry-level EPA-certified
gayaneshka [121]

Answer:

A private plane pilot is a mid-level position.

Explanation:

The six pilot certifications in the US are as follows:

  1. Sport Pilot
  2. Recreational Pilot
  3. Private Plane Pilot
  4. Commercial Plane Pilot
  5. Flight Instructor
  6. Airline Transport Pilot

From this listing, it is evident that the Private Plane Pilot is in the mid of the line so it is a mid-level position.

3 0
3 years ago
Open the"stateData3.c" program and try to understand how the tokenization works. If you open the input file "stateData.txt", you
babymother [125]

Answer:

Kindly see explaination

Explanation:

Code

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#define size 200

int main(void)

{

int const numStates = 50;

char tempBuffer[size];

char tmp[size];

char fileName[] = "stateData.txt"; // Name of the text file (input file) which contains states and its populations

char outFile[] = "stateDataOutput1.txt"; // Output file name

// Open the input file, quit if it fails...

FILE *instream = fopen(fileName, "r");

/* Output File variable */

FILE *opstream;

if(instream == NULL) {

fprintf(stderr, "Unable to open file: %s\n", fileName);

exit(1);

}

//TODO: Open the output file in write ("w") mode

/* Opening output file in write mode */

opstream = fopen(outFile, "w");

//TODO: Read the file, line by line and write each line into the output file

//Reading data from file

while(fgets(tmp, size, instream) != NULL)

{

//Writing data to file

fputs(tmp, opstream);

}

// Close the input file

fclose(instream);

//TODO: Close the output file

/* Closing output file */

fclose(opstream);

return 0;

}

5 0
3 years ago
The loneliest people are to kindest
valkas [14]

Answer:

The most damaged people are the wisest is a fact

Explanation:

5 0
3 years ago
Read 2 more answers
What causes the charging system warning lamp to go out when the engine starts up?
Flura [38]
B is the answer I believe so
7 0
3 years ago
Consider two different versions of algorithm for finding gcd of two numbers (as given below), Estimate how many times faster it
juin [17]

Answer:

Explanation:

Step 1:

a) The formula for compute greatest advisor is

     gcd(m,n) = gcd (n,m mod n)

the gcd(31415,14142) by applying Euclid's algorithm is

    gcd(31,415,14,142) =gcd(14,142,3,131)

                                  =gcd=(3,131, 1,618)

                                   =gcd(1,618, 1,513)

                                   =gcd(1,513, 105)

                                   =gcd(105, 43)

                                    =gcd(43, 19)

                                     =gcd(19, 5)

                                      =gcd(5, 4)

                                      =gcd(4, 1)

                                      =gcd(1, 0)

                                      =1

STEP 2

b)  The number of comparison of given input with the algorithm based on  checking consecutive integers and Euclid's algorithm is

     The number of division using Euclid's algorithm =10 from part (a)

      The consecutive integer checking algorithm:

      The number of iterations =14,142 and 1 or 2 division of iteration.

        14,142 ∠= number of division∠ = 2*14,142

         Euclid's algorithm is faster by at least 14,142/10 =1400 times

          At most 2*14,142/10 =2800 times.

5 0
3 years ago
Other questions:
  • The input power for a thermostat is wired to the
    8·1 answer
  • If a barrel of oil weighs 1.5 kN, calculate the specific weight, density, and specific gravity of the oil. The barrel weighs 110
    7·1 answer
  • What is best for electrical engineer​
    12·2 answers
  • In the 5 Code of Federal Regulations (C.F.R.), it is recommended that an individual has security awareness training before s/he
    8·2 answers
  • Using the data from the table, what is P(3)?!
    9·1 answer
  • Create an array of 10 size and assign 10 random numbers. Now find the sum of the array using for and while loop.
    6·1 answer
  • Which technical planning document defines support tasks?
    7·1 answer
  • I need help due today please help
    5·1 answer
  • (a) calculate the moment at point "c", where point "c" is the square 3'' below the centroid
    13·1 answer
  • Consider the function f(x)=/x/
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!