answer.
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
lord
26 days ago
9

5.15 LAB: Output values below an amount Write a program that first gets a list of integers from input. The input begins with an

integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. 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.

Computers and Technology
2 answers:
Harlamova29_29 [932]26 days ago
7 0

Response:

def print_ints_below_or_equal_to_limit(values, limit):

  for num in values:

    if num <= limit:

        print(num)

def retrieve_user_inputs():

  count = int(input())

  numbers = []

  for j in range(count):

    numbers.append(int(input()))

  return numbers

if __name__ == '__main__':

  inputs = retrieve_user_inputs()

  threshold = int(input())

  print_ints_below_or_equal_to_limit(inputs, threshold)

Clarification:

zubka84 [942]26 days ago
5 0

Answer:

# The terminal will wait for user input

# The input entered by the user is assigned to user_input

user_input = input()

# The user's input is split by spaces and stored in integerlist

integerlist = user_input.split(" ")

# The last entry in integerlist is saved as threshold

threshold = int(integerlist[-1])

# A for loop will iterate from index 1 to the second to last element in the list

# Each element is compared against the threshold

# Elements less than the threshold will be printed out

# The loop begins at index 1 because index 0 represents the number of elements

for i in range(1, len(integerlist) - 1):

   if int(integerlist[i]) < threshold:

       print(integerlist[i], sep="")

Explanation:

The code provided is written in Python and includes adequate comments explaining its functionality.

Moreover, a sample output of the program upon execution is included.

You might be interested in
A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The n
zubka84 [942]

Answer:

EMI and RFI

Explanation:

EMI, or Electromagnetic Interference, can also be referred to as Radio-frequency Interference (RFI) within the radio frequency domain.

An unshielded ethernet cable, made from copper, might function as an antenna; any external noise that interferes with it can corrupt the data signal, resulting in data integrity issues and distorted signals.

6 0
8 days ago
An employee of a large corporation remotely logs into the company using the appropriate username and password. The employee is a
Natasha_Volkova [897]

Respuesta: Te proporcioné 6 opciones de las cuales puedes elegir.

Integridad

Escalabilidad

Calidad de Servicio

Tolerancia a Fallos

Redes de Línea Eléctrica

Seguridad

6 0
1 month ago
How can you check an orthographic drawing to be sure there are no missing lines
maria [879]
Using a magnifying glass.
4 0
21 day ago
Someone else can drive your car if _____.
8_murik_8 [892]

Answer:

C. you possess insurance documentation

Explanation:

Being a resident does not automatically grant permission to operate a vehicle. For instance, a person might have residency but might also have a suspended license, which means they are unable to drive.

Typically, insurance applies to the CAR rather than the individual. Therefore, the general guideline is:

A different person is permitted to drive your vehicle if you possess proof of insurance.

6 0
27 days ago
Read 2 more answers
24. Which of the following statements about Emergency Support Functions (ESFs) is correct?
8_murik_8 [892]

(ESFs) is accurate: ESFs are not solely a federal coordinating mechanism.

5 0
1 month ago
Other questions:
  • In what areas is Leslie's underspending hurting her budget select all that apply
    5·1 answer
  • The Pentium 4 Prescott processor, released in 2004, had a clock rate of 3.6 GHz and voltage of 1.25 V. Assume that, on average,
    8·1 answer
  • 6. Write pseudo code that will perform the following. a) Read in 5 separate numbers. b) Calculate the average of the five number
    6·1 answer
  • Strlen("seven"); what is the output?
    14·1 answer
  • Which of the following describes ETL? a) A process that transforms information using a common set of enterprise definitions b) A
    14·1 answer
  • array of String objects, words, has been properly declared and initialized. Each element of words contains a String consisting o
    11·1 answer
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 the output is
    5·1 answer
  • The principal that users have access to only network resources when an administrator explicitly grants them is called __________
    6·1 answer
  • Technological improvements have allowed people to inhabit a wider variety of places more easily. Please select the best answer f
    6·2 answers
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!