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
malfutka [58]
2 years ago
11

Output values below an amount

Computers and Technology
1 answer:
valina [46]2 years ago
7 0

Answer:

Explanation:

The following code is written in Python and it is a function called filter, which takes in the requested inputs. It then places the threshold in its own variable and pops it out of the array of inputs. Then it loops through the array comparing each element with the threshold and printing out all of the ones that are less than or equal to the threshold.

def filter():

   num_of_elements = input("Enter a number: ")

   count = 0

   arr_of_nums = []

   while count <= int(num_of_elements):

       arr_of_nums.append(input("Enter a number: "))

       count += 1

   threshold = arr_of_nums[-1]

   arr_of_nums.pop(-1)

   print(threshold)

   for element in arr_of_nums:

       if int(element) < int(threshold):

           print(element)

       else:

           continue

You might be interested in
Which heading size fits for the word headings​
hjlf
The first one h4 is yhat
3 0
3 years ago
Read 2 more answers
The question is in the photo
Anastaziya [24]

Answer:

a

the most suitable answer

8 0
2 years ago
How will you keep the buzz going post-hackathon?
Anna71 [15]

Answer:

it would be nice if you gave some form of info here

Explanation:

in other words without information no help aka I'm slow and just need points

8 0
1 year ago
What is a computer software?​
Fofino [41]

Answer:

Software, instructions that tell a computer what to do The term was coined to differentiate these instructions from hardware  the physical components of a computer system.

Explanation:

6 0
2 years ago
Read 2 more answers
Which image file format is the most widely used?
Ostrovityanka [42]

Answer: jpeg because its a lot of people use it for quaity

7 0
1 year ago
Other questions:
  • Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
    13·1 answer
  • Some financial institutions can be really bad about putting unexpected charges
    12·1 answer
  • My home PC has IP address 192.168.1.22 and connects to the Internet through a NAT router. Assume I am downloading a web page fro
    5·1 answer
  • In the RGB model, which color is formed by combining the constituent colors?
    14·2 answers
  • _____ can render data useless to unauthorized users who might have violated some of the database security layers.
    7·1 answer
  • How to write greater than or equal to in excel if function
    7·1 answer
  • Choose all the answers that apply.
    15·1 answer
  • Question 2/21
    11·1 answer
  • Which is the best choice to explain why a human resource manager is so
    5·1 answer
  • Write the two features of a mouse.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!