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
mote1985 [20]
3 years ago
15

Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer

s 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
Computers and Technology
1 answer:
Gre4nikov [31]3 years ago
7 0

Answer:

The program in Python is as follows:

num = int(input())

numList = []

for i in range(num+1):

   numInput = int(input())

   numList.append(numInput)

for i in range(len(numList)-1):

   if numList[i] <= numList[-1]:

       print(numList[i],end=" ")

Explanation:

This gets input for the number of integers

num = int(input())

This initializes an empty list

numList = []

This iterates through the number of integers and gets input for each

for i in range(num+1):

   numInput = int(input())

The inputs including the threshold are appended to the list

   numList.append(numInput)

This iterates through the list

for i in range(len(numList)-1):

All inputs less than or equal to the threshold are printed

   if numList[i] <= numList[-1]:

       print(numList[i],end=" ")

You might be interested in
Is it safe for me to use normal glue to stick things on my laptop like stickers or pics?
vaieri [72.5K]

Answer:

I think you should be fine, as long as you're just sticking it to the backside of your laptop. (For MacBooks, this is the part of the laptop with the apple symbol.) You can easily wash glue off with a cleaner such as Goo Gone or Pledge. There's better solutions, like ordering a case for your computer and putting the stickers on there, but I guess it's fine to stick them onto your computer. I'll attach a photo of an example of case with stickers.

<em>Hope this helps! Feel free to give me Brainliest if you feel this helped. Have a good day, and feel free to comment any questions below you may have. :)</em>

5 0
3 years ago
Read 2 more answers
What's the answer plssss​
Savatey [412]

Answer:

TELL IT TO YOUR TEACHERS HOW

8 0
3 years ago
When shopping on the web, it is better to pay for your purchase with a debit card rather than a credit card.
vaieri [72.5K]
Correct, debit cards use money you already have. Credit cards basically 'loan' money, which can lead to debt if you overuse it or fail to pay it off
8 0
3 years ago
Read 2 more answers
What is the keyboard command that allows you to copy text
alex41 [277]

Control + C For Desktops and Windows

Control +V to paste

Command+ C For Macbooks

Command+ V to paste

Hope this helps

-Dante


5 0
3 years ago
Read 2 more answers
What is it called when an attacker convinces you to enter personal information at an imposter website after receiving an email f
yaroslaw [1]

Answer:

Phishing

Explanation:

Phishing is a type of cyber attack in which the attacker masquerades as a trusted entity via e-mail and trick the recipient into clicking a malicious link that could steal user data including login details, credit card information e.t.c A phishing attack can have devastating effects such as Identity theft, Unauthorised purchase or stealing of funds on individuals.

The common types of phishing are<em>: Vishing, Smishing, Email Phishing, Search Engine Vishing, Whaling</em> e.t.c

3 0
4 years ago
Read 2 more answers
Other questions:
  • True or False? A supervisory control and data acquisition (SCADA) device is a computer that controls motors, valves, and other d
    13·1 answer
  • To move down one paragraph, press the ____ key(s).
    15·1 answer
  • What instruments are used the measure voltage, current, and resistance
    7·1 answer
  • Discuss OPENGL instruction to draw the following drawing primatives:
    14·1 answer
  • Needed urgently what are short cut keys
    8·2 answers
  • Which law was established to prevent law enforcement agencies from accessing communication through telephone and digital mediums
    8·2 answers
  • Why is it unlawful for an employer to refuse to employ someone based solely on their gender without evidence that such a charact
    9·1 answer
  • To display data in a certain manner, like alphabetical order, is called
    5·2 answers
  • Functions can accept any number of arguments.
    8·1 answer
  • You have a server that has a 100basefx network interface card that you need to connect to a switch. the switch only has 100baset
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!