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
Leona [35]
3 years ago
8

The longest_word function is used to compare 3 words. It should return the word with the most number of characters (and the firs

t in the list when they have the same length). Fill in the blank to make this happen.
Engineering
1 answer:
NARA [144]3 years ago
4 0

Answer:

len(word2) >= len(word1) and len(word2) >= len(word3):

Question with blank is below

def longest_word(word1,word2,word3):

   if len(word1) >= len(word2) and len(word1) >= len(word3):

       word = word1

   elif _________________________________________

       word = word2

   else:

       word = word3

   return word

print(longest_word("chair","couch","table"))

print(longest_word("bed","bath","beyond"))

print(longest_word("laptop","notebook","desktop"))

print(longest_word("hi","cat","Cow"))

Explanation

In line 1 of the code word1, word2, and word3 are the parameters used to for the defining the longest_word function. They will be replaced by 3 words to be compared. The code that is filled in the blank is len(word2) >= len(word1) and len(word2) >= len(word3): It is a conditional statement that is true only if the number of characters in the string of word2 is greater than or equal to word1 and word2 is greater than that of word3 .

You might be interested in
True or false? if i were to hook up an ac voltage source to a resistor, the voltage drop across the resistor would be in phase w
hodyreva [135]

Answer: True

Explanation:

4 0
2 years ago
Air modeled as an ideal gas enters a turbine operating at steady state at 1040 K, 278 kPa and exits at 120 kPa. The mass flow ra
gladu [14]

Answer:

a) T_{2}=837.2K

b) e=91.3 %

Explanation:

A) First, let's write the energy balance:

W=m*(h_{2}-h_{1})\\W=m*Cp*(T_{2}-T_{1})  (The enthalpy of an ideal gas is just function of the temperature, not the pressure).

The Cp of air is: 1.004 \frac{kJ}{kgK} And its specific R constant is 0.287 \frac{kJ}{kgK}.

The only unknown from the energy balance is T_{2}, so it is possible to calculate it. The power must be negative because the work is done by the fluid, so the energy is going out from it.

T_{2}=T_{1}+\frac{W}{mCp}=1040K-\frac{1120kW}{5.5\frac{kg}{s}*1.004\frac{kJ}{kgk}} \\T_{2}=837.2K

B) The isentropic efficiency (e) is defined as:

e=\frac{h_{2}-h_{1}}{h_{2s}-h_{1}}

Where {h_{2s} is the isentropic enthalpy at the exit of the turbine for the isentropic process. The only missing in the last equation is that variable, because h_{2}-h_{1} can be obtained from the energy balance  \frac{W}{m}=h_{2}-h_{1}

h_{2}-h_{1}=\frac{-1120kW}{5.5\frac{kg}{s}}=-203.64\frac{kJ}{kg}

An entropy change for an ideal gas with  constant Cp is given by:

s_{2}-s_{1}=Cpln(\frac{T_{2}}{T_{1}})-Rln(\frac{P_{2}}{P_{1}})

You can review its deduction on van Wylen 6 Edition, section 8.10.

For the isentropic process the equation is:

0=Cpln(\frac{T_{2}}{T_{1}})-Rln(\frac{P_{2}}{P_{1}})\\Rln(\frac{P_{2}}{P_{1}})=Cpln(\frac{T_{2}}{T_{1}})

Applying logarithm properties:

ln((\frac{P_{2}}{P_{1}})^{R} )=ln((\frac{T_{2}}{T_{1}})^{Cp} )\\(\frac{P_{2}}{P_{1}})^{R}=(\frac{T_{2}}{T_{1}})^{Cp}\\(\frac{P_{2}}{P_{1}})^{R/Cp}=(\frac{T_{2}}{T_{1}})\\T_{2}=T_{1}(\frac{P_{2}}{P_{1}})^{R/Cp}

Then,

T_{2}=1040K(\frac{120kPa}{278kPa})^{0.287/1.004}=817.96K

So, now it is possible to calculate h_{2s}-h_{1}:

h_{2s}-h_{1}}=Cp(T_{2s}-T_{1}})=1.004\frac{kJ}{kgK}*(817.96K-1040K)=-222.92\frac{kJ}{kg}

Finally, the efficiency can be calculated:

e=\frac{h_{2}-h_{1}}{h_{2s}-h_{1}}=\frac{-203.64\frac{kJ}{kg}}{-222.92\frac{kJ}{kg}}\\e=0.913=91.3 %

4 0
3 years ago
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If user
Thepotemich [5.8K]

Answer:

import java.util.Scanner;

public class FindMatchValue {

  public static void main (String [] args) {

     Scanner scnr = new Scanner(System.in);

     final int NUM_VALS = 4;

     int[] userValues = new int[NUM_VALS];

     int i;

     int matchValue;

     int numMatches = -99; // Assign numMatches with 0 before your for loop

     matchValue = scnr.nextInt();

     for (i = 0; i < userValues.length; ++i) {

        userValues[i] = scnr.nextInt();

     }

     /* Your solution goes here */

         numMatches = 0;

     for (i = 0; i < userValues.length; ++i) {

        if(userValues[i] == matchValue) {

                       numMatches++;

                }

     }

     System.out.println("matchValue: " + matchValue + ", numMatches: " + numMatches);

  }

}

8 0
3 years ago
Document the XSS stored exploit script: Use the View Source feature of the web page and create a screenshot of the few lines cod
Natali [406]

Answer:

Hold on let me ask my brother

Explanation:

5 0
3 years ago
What application of bioengineering uses principles of electronics and computer science to design products?
Flauer [41]

The application of electro bioengineering uses principles of nick and computer science to design products is application of electrical engineering principles to biology, medicine, conduct, or health.

<h3>What is Bioelectronics?</h3>
  • Bioelectronics is the application of electrical engineering principles to biology, medicine, conduct, or health.
  • It advances the fundamental concepts, creates knowledge for the molecular to the organ techniques levels, and develops creative devices or methods for the deterrence, diagnosis, and treatment of disease, for patient rehabilitation, and for improving health.
  • Bio electromagnetics, instrumentation, neural networks, robotics, and detector technologies are some of the disciplines necessary to develop new knowledge and creations in this area.
  • A keystone of this research area is the building of and real-world devices and systems.
  • Onsite facilities for prototyping and testing instrumentation systems, fabricating and measuring the performance of implantable devices, and making robotic prostheses, are readily available.
  • New detectors and sensor arrays are microfabricated in a 2,000 sq ft cleanroom.

To learn more about Bioelectronics, refer to:

brainly.com/question/21819443

#SPJ4

4 0
2 years ago
Other questions:
  • Hey, I have a question, I was thinking that if you have engineering skills or drawing skill you could help me to start a project
    15·1 answer
  • One kilogram of water fills a 150-L rigid container at an initial pressure of 2 MPa. The container is then cooled to 40∘C. Deter
    7·1 answer
  • A vertical piston-cylinder device contains water and is being heated on top of a range. During the process, 10 kJ of heat is tra
    9·1 answer
  • In dynamics, the friction force acting on a moving object is always a) in the same direction of its motion b) a kinetic friction
    15·1 answer
  • . (20 pts) A horizontal cylindrical pipe (k = 10 W/m·K) has an outer diameter of 15 cm and a wall thickness of 5 cm. The pipe is
    14·1 answer
  • The section should span between 10.9 and 13.4 cm (4.30 and 5.30 inches) as measured from the end supports and should be able to
    5·1 answer
  • Suppose to build RSA crypto system you picked primes "p" and "q" as 3 and 7 and "e" as 5 what are the public and private keys? W
    11·1 answer
  • A coil having a resistance of 10 ohms and an inductance of 4 H is switched across a 20W dc source. Calculate (a) time required b
    9·1 answer
  • A team of engineers is working on a design to increase the power of a hydraulic lever. They have brainstormed several ideas. Whi
    13·1 answer
  • Which thematic group is involved in the transmission and generation of electrical power?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!