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
Alona [7]
3 years ago
13

12.28 LAB: Output values in a list below a user defined amount - functions Write a program that first gets a list of integers fr

om input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.
Engineering
1 answer:
Anastaziya [24]3 years ago
8 0

Answer:

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

   for value in user_values:

       if value < upper_threshold:

           print(value)  

def get_user_values():

   n = int(input())

   lst = []

   for i in range(n):

       lst.append(int(input()))

   return lst  

if __name__ == '__main__':

   userValues = get_user_values()

   upperThreshold = int(input())

   output_ints_less_than_or_equal_to_threshold(userValues, upperThreshold)

You might be interested in
Which is/are not a mechanism commonly associated with tool wear (mark all that apply)?a. Adhesion b. Attrition c. Abrasion d. Co
butalik [34]

Answer: d)Coercion

Explanation:Tool wear is defined as the situation when the cutting tool is subjected to the regular process of cutting metal then they tend to wear because of the continuous action of cutting and facing stresses and pressure . The mechanism that does not happen during this process are coercion that means the process of exerting forces on any material forcefully against the will or need. Therefore, adhesion,attrition and abrasion are the process of tool wear .So the correct option is (d)

5 0
3 years ago
In the idealized Otto cycle, heat is added during: a. Isentropic Compression b. Constant (minimum) volume c. Constant (maximum)
docker41 [41]

Answer:

(b) Constant (minimum) volume

Explanation:

In the idealized Otto cycle there are 4 process that are

  • Reversible adiabatic compression  
  • Addition of heat at constant volume
  • Reversible adiabatic expansion
  • Rejection of constant volume

So from above discussion we can see that heat is added when there is constant (minimum) volume which is given in option (b) so option (b) will be the correct answer

3 0
3 years ago
Python:
stira [4]

Answer:

# Python Program to Print  

# all subsets of given size of a set  

 

import itertools  

 

def findsubsets(s, n):  

   return list(itertools.combinations(s, n))  

 

# Driver Code  

s = {1, 2, 3}  

n = 2

 

print(findsubsets(s, n))

-----------------------------------------------

# Python Program to Print  

# all subsets of given size of a set  

 

import itertools  

# def findsubsets(s, n):  

def findsubsets(s, n):  

   return [set(i) for i in itertools.combinations(s, n)]  

     

# Driver Code  

s = {1, 2, 3, 4}  

n = 3

 

print(findsubsets(s, n))

-------------------------------------------------------------

# Python Program to Print  

# all subsets of given size of a set  

 

import itertools  

from itertools import combinations, chain  

 

def findsubsets(s, n):  

   return list(map(set, itertools.combinations(s, n)))  

     

# Driver Code  

s = {1, 2, 3}  

n = 2

 

print(findsubsets(s, n))

4 0
4 years ago
What is the stress concentration factor of a shaft in torsion, where D=1.25 in. and d=1 in. and the fillet radius is, r=0.2 in.a
klio [65]

Answer:

Concentration factor will be 1.2

So option (C) will be correct answer

Explanation:

We have given outer diameter D = 1.25 in

And inner diameter d = 1 in and fillet ratio r = 0.2 in

So \frac{r}{d} ratio will be =\frac{0.2}{1}=0.2

And \frac{D}{d} ratio will be =\frac{1.25}{1}=1.25

Now from the graph in shaft vs torsion the value of concentration factor will be 1.2

So concentration factor will be 1.2

So option (C) will be correct answer.

6 0
3 years ago
Name the main classes of polymer and define their characteristic properties
Svetlanka [38]

Answer:

Polymers are the naturally occurring or synthetic macromolecules that are composed of repeating subunits, called monomers.

The three main classes of polymers are: thermoplastic, thermosetting, and the elastomers.

Thermoplastic polymers have linear bonding. These polymers can be melted again and thus can recycled.

Thermosetting polymers have cross-linked bonding. These polymers decompose when heated and thus can not be remelted and recycled.

Elastomers have linear bonding with some cross-linking. These polymers extreme elastic extensibility and thus can revert back to its original shape after deformation, without causing any permanent damage.

8 0
4 years ago
Other questions:
  • A evolução da malha rodoviária do Brasil é um marco notável
    9·1 answer
  • g (d) Usually, in the case of two finite-duration signals like in parts (a) and (b), the convolution integralmust be evaluated i
    7·1 answer
  • Steam enters an adiabatic nozzle at l MPa, 260 C, 30 m/s and exits at 0.3 MPa and 160 'C. Calculate the velocity at the exit.
    13·1 answer
  • Consider a cubic block whose sides are 6 cm long and a cylindrical block whose height and diameter are also 6 cm. both blocks ar
    8·1 answer
  • Water at 15°C (rho = 999.1 kg/m^3) from a garden hose fills a 1.5-L container in 2.5 s. Assume that the volume flow rate, tempe
    14·1 answer
  • Determine the greatest pressure drop allowed over the 10-m-long pipe caused by viscous friction, so the flow remains laminar.
    14·1 answer
  • 1. Two aluminium strips and a steel strip are to be bonded together to form a composite bar. The modulus of elasticity of steel
    11·1 answer
  • If a soil has e=0.72, moisture content = 12% and Gs=2.72, find the weight of water in KN/m3 to be added to make the soil saturat
    6·1 answer
  • You have discovered an element that is a poor conductor of electricity, has a low melting point, and is a gas at room temperatur
    6·1 answer
  • Which of the following is not a task electricians typically do when maintaining a building’s electrical system?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!