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
Explain in detail the difference between the microstructures of a cold worked sample and Recrystallized sample ?
MrRa [10]

Answer:

A recrystallization process differs mainly from a restoration process (microestructures of a cold worked sample) in that  the first, the microstructure of the final product consists mainly of  high angle borders.

Explanation:

The microstructure of a cold worked material has a high energy stored in dislocations and subgrains. During a heat treatment, this microstructure evolves in order to achieve a more stable state by reducing its energy. The complex microscopic mechanisms that take place during this process have been traditionally encompassed in three categories: restoration, recrystallization and grain growth, which will be discussed later.

These processes generally lead to the total or partial recovery of the original properties of the material (ductility, resistance). They can take place under dynamic conditions, that is, during thermomechanical processing or when the material is subsequently deformed at high temperature, and under static conditions, that is, during a heat treatment after thermomechanical processing.

The term <em>restoration</em> encompasses the following succession of micromechanism: formation of dislocation cells,  annihilation of dislocations within them, formation of subgrains and their growth.

<em>A recrystallization process differs mainly from a restoration process in that in the first one the microstructure of the final product is mainly formed by high-angle borders.</em>

7 0
3 years ago
You want to determine whether the race of the defendant has an impact on jury verdicts. You assign participants to watch a trial
Andru [333]

Answer:

The confidence scale represents an ordinal scale of measurement

Explanation:

An ordinal scale or level of measurement is used to measure attributes that can be ranked or ordered, but the interval between the attributes do not have quantitative significance. In this case, the measurement was done on a scale of 1 - 7, with a "1" being; not all that race of defendant has an impact on jury verdicts and a "7" being "very" meaning that race indeed has impact on jury verdicts. Another example can be a survey carried out on the level of customer satisfaction on a particular product, with "1" most dissatisfied and "10 " representing most satisfied. In the first example, it is wrong to say that the difference between 1 being "not at all" and maybe 3 is the same as the difference between 5 and 7 which have different connotations, because the numbers are merely for tagging and not to quantify.

Other levels of measurement include:

1. Nominal: this is the simplest level of measurement and it is simply used to categorize the attributes. Example is taking a survey on gender in the categories of male, female and transgender.

2. Interval: the interval scale is used when the distance between two attributes have meanings but there is no true zero value associated with the scale.

3. Ratio: this combines all the other three levels of measurement and is used to categorize, used to show ranking, has meaningful distances between the attributes and the scale has a true zero point. Example is the measurement of temperature using the celcius scale thermometer, where there is a true zero point at 0°C and the distance between 5°C and 10°C is the same as the distance between 10°C and 15°C.

6 0
3 years ago
The following C program asks the user for two input null-terminated strings, each stored in uninitialized 100-byte buffer, and c
marissa [1.9K]

Answer:

Code is given below:

Explanation:

.data  

str1: .space 20  

str2: .space 20  

msg1:.asciiz "Please enter string (max 20 characters): "  

msg2: .asciiz "\n Please enter string (max 20 chars): "  

msg3:.asciiz "\nSAME"  

msg4:.asciiz "\nNOT SAME"  

.text

.globl main

main:  

   li $v0,4        #loads msg1  

   la $a0,msg1  

   syscall

   li $v0,8

   la $a0,str1

   addi $a1,$zero,20

   syscall          #got string to manipulate

   li $v0,4        #loads msg2

   la $a0,msg2

   syscall

   li $v0,8

   la $a0,str2

   addi $a1,$zero,20

   syscall         #got string  

       la $a0,str1             #pass address of str1  

   la $a1,str2         #pass address of str2  

   jal methodComp      #call methodComp  

   beq $v0,$zero,ok    #check result  

   li $v0,4

   la $a0,msg4

   syscall

   j exit

ok:  

   li $v0,4  

   la $a0,msg3  

   syscall  

exit:  

   li $v0,10  

   syscall  

methodComp:  

   add $t0,$zero,$zero  

   add $t1,$zero,$a0  

   add $t2,$zero,$a1  

loop:  

   lb $t3($t1)         #load a byte from each string  

   lb $t4($t2)  

   beqz $t3,checkt2    #str1 end  

   beqz $t4,missmatch  

   slt $t5,$t3,$t4     #compare two bytes  

   bnez $t5,missmatch  

   addi $t1,$t1,1      #t1 points to the next byte of str1  

   addi $t2,$t2,1  

   j loop  

missmatch:    

   addi $v0,$zero,1  

   j endfunction  

checkt2:  

   bnez $t4,missmatch  

   add $v0,$zero,$zero  

endfunction:  

   jr $ra

3 0
3 years ago
A rectangular channel 2 m wide carries 3 m3 /s of water at a depth of 1.2 m. If an obstruction 40 cm wide is placed in the middl
Marta_Voda [28]

harden you could either me or leave

harden you could either me or leave

Xharden you could either me or leave

harden you could either me or leave

BBB

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED RB

harden you could either me or leave

harden you could either me or leave

harden you could either me or leave

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

harden you could either me or leave

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

8 0
3 years ago
The difference between an initial condition and a boundary condition for conduction in a solid is:___________
leva [86]

Answer:

c. an initial condition specifies the temperature at the start of the problem and a boundary condition provides information about temperatures on the boundaries.

Explanation:

Conduction refers to the transfer of thermal energy or electric charge as a result of the movement of particles. When the conduction relates to electric charge, it is known as electrical conduction while when it relates to thermal energy, it is known as heat conduction.

In the process of heat conduction, thermal energy is usually transferred from fast moving particles to slow moving particles during the collision of these particles. Also, thermal energy is typically transferred between objects that has different degrees of temperature and materials (particles) that are directly in contact with each other but differ in their ability to accept or give up electrons.

Any material or object that allow the conduction (transfer) of electric charge or thermal energy is generally referred to as a conductor. Conductors include metal, steel, aluminum, copper, frying pan, pot, spoon etc.

Hence, the difference between an initial condition and a boundary condition for conduction in a solid is that an initial condition specifies the temperature at the start of the problem and a boundary condition provides information about temperatures on the boundaries.

7 0
2 years ago
Other questions:
  • Air is compressed in a piston-cylinder device. List three examples of irreversibilities that could occur
    13·1 answer
  • The direction of rotation of a dc series motor or a universal motor connected to a dc power source A) depends on the polarities
    15·1 answer
  • Most licensed architects are members of which association?
    13·2 answers
  • How many grams of water at 5.00 °C would we need to mix with 140.0 g of water at 85.0 °C to obtain a final temperature of 43.0 °
    6·1 answer
  • B1) 20 pts. The thickness of each of the two sheets to be resistance spot welded is 3.5 mm. It is desired to form a weld nugget
    12·1 answer
  • Question 3. Assign boston_under_10 and manila_under_10 to the percentage of rides that are less than 10 minutes in their respect
    14·1 answer
  • Users say that the game is interesting to look at but the music gets annoying
    9·1 answer
  • Poems that focus on one image usually have what purpose? PLEASE HELP MEH!!
    7·2 answers
  • An ideal vapor-compression refrigeration cycle using refrigerant-134a as the working fluid is used to cool a brine solution to −
    12·1 answer
  • Technician a s ays a shorted circuit can generate excessive heat. technician b says a shorted circuit will cause the circuit pro
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!