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 steam reformer operating at 650C and 1 atm uses propane as fuel for hydrogen production. At the given operating conditions, th
dusya [7]

Answer:

Explanation:

a) for shifting reactions,

Kps =  ph2 pco2/pcoph20

=[h2] [co2]/[co] [h2o]

h2 + co2 + h2O + co + c3H8 = 1

it implies that

H2 + 0.09 + H2O + 0.08 + 0.05 = 1

solving the system of equation yields

H2 = 0.5308,

H2O = 0.2942

B)  according to Le chatelain's principle for a slightly exothermic reaction, an increase in temperature favors the reverse reaction producing less hydrogen. As a result, concentration of hydrogen in the reformation decreases with an increasing temperature.

c) to calculate the maximum hydrogen yield , both reaction must be complete

C3H8 + 3H2O ⇒ 3CO + 7H2( REFORMING)

CO + H2O ⇒ CO2 + H2 ( SHIFTING)

C3H8 + 6H2O ⇒ 3CO2 + 10 H2 ( OVER ALL)

SO,

Maximum hydrogen yield

= 10mol h2/3 molco2 + 10molh2

= 0.77

⇒ 77%

3 0
3 years ago
Determine whether or not each of the following signals is periodic.
Sloan [31]

Answer:

a) periodic (N = 1)

b) not periodic

c) not periodic

d) periodic (N = 8)

e) periodic (N = 16)

Explanation:

For function to be a periodic: f(n) = f(n+N)

a) x[n]=sin(\frac{8\pi}{2}n+1)\\\\sin(\frac{8\pi}{2}n+1)=sin(4\pi n+1)

It is periodic with fundamental period N = 1

b) x[n]=cos(\frac{n}{8} -\pi)\\\\\frac{1}{8} N=2\pi k

N must be integer. So it is nor periodic

c) x[n]=cos(\frac{\pi}{8} n^2)\\\\cos(\frac{\pi}{8} (n+N)^2)=cos(\frac{\pi}{8} (n^2+N^2+2nN)\\\\N^2 = 16 \:\:or\:\:2nN=16

Since N is dependent to n. So it is not periodic.

d) x[n]=cos(\frac{\pi }{2}  n) cos(\frac{\pi }{4}  n)\\\\x[n] = \frac{1}{2} cos(\frac{3\pi }{4} n) + \frac{1}{2} cos(\frac{\pi }{4} n)\\\\N_1=8\:\:and\:\:N_2=8\\

So it is periodic with fundamental period N = 8.

e) x[n]=2cos(\frac{\pi }{4}  n)+sin(\frac{\pi }{8} n)-2cos(\frac{\pi }{2} n+\frac{\pi }{6} )\\\\N_1=8\:\:and\:\:N_2=16\:\:and\:\:N_3=4

So it is periodic with N = 16.

3 0
3 years ago
Why is an integrated circuit (IC) referred to as a special device?"<br> points more than 10 plz help
sladkih [1.3K]

Answer:

Because IC microcomputers are smaller and more versatile than previous control mechanisms, they allow the equipment to respond to a wider range of input and produce a wider range of output. They can also be reprogrammed without having to redesign the control circuitry

Explanation:

5 0
3 years ago
A European car manufacturer reports that the fuel efficiency of the new MicroCar is 48.5 km/L highway and 42.0 km/L city. What a
statuscvo [17]

Answer:

Fuel efficiency for highway = 114.08 miles/gallon

Fuel efficiency for city = 98.79 miles/gallon

Explanation:

1 gallon = 3.7854 litres

1 mile = 1.6093 km

Let's first convert the efficiency to km/gallon:

48.5 km/litre = (48.5 * 3.7854) km/gallon

48.5 km/litre =  183.5919 km/gallon (highway)

42.0 km/litre = (42.0 * 3.7854) km/gallon

42.0 km/litre = 158.9868 km/gallon (city)

Next, we convert these to miles/gallon:

183.5919 km/gallon = (183.5919 / 1.6093) miles/gallon

183.5919 km/gallon = 114.08 miles/gallon (highway)

158.9868 km/gallon = (158.9868 /1.6093) miles/gallon

158.9868 km/gallon = 98.79 miles/gallon (city)

3 0
3 years ago
In ________ programming, the programming is centered on objects that are created from abstract data types that encapsulate data
Contact [7]

Answer:

<em>Object-oriented</em>

Explanation:

<em>Object Oriented programming</em> <em>(OOP)</em> is a specific way of programming, where the code is organized in units called classes, from which objects are created that are related to each other to achieve the objectives of the applications. Object-oriented programming took over as the dominant programming style in the mid-1980s, largely due to the influence of C ++. Its dominance was consolidated thanks to the rise of graphical user interfaces, for which object-oriented programming is particularly well suited. Its most important characteristics are the following:

  • Encapsulation
  • Polymorphism
  • Abstraction
  • Inheritance

8 0
3 years ago
Other questions:
  • A well-insulated, rigid tank, having a volume of 2 m3 , contains saturated water vapor at 120 ◦C. The water is stirred until the
    13·1 answer
  • Engineering Questions
    15·2 answers
  • . A cylindrical metal specimen having an original diameter of 12.8 mm (0.505 in.) and gauge length of 50.80 mm (2.000 in.) is pu
    11·1 answer
  • A square power screw has a mean diameter of 30 mm and a pitch of 4 mm with single thread. The collar diameter can be assumed to
    14·1 answer
  • A piston–cylinder assembly contains 5 kg of air, initially at 2.0 bar, 30 C. The air undergoes a process to a state where the pr
    6·1 answer
  • Match each situation with the type of material (conductor or inductor) you would want to use in it. You need to connect a recent
    15·1 answer
  • The temperature controller for a clothes dryer consists of a bimetallic switch mounted on an electrical heater attached to a wal
    12·1 answer
  • If it is desired to lay off a distance of 10,000' with a total error of no more than ± 0.30 ft. If a 100' tape is used and the
    8·1 answer
  • My brother john has never learned this lesson is that a sentence
    11·1 answer
  • When jump-starting a car, always remember
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!