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
wariber [46]
3 years ago
14

5.20 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. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50,60,75,
Computers and Technology
1 answer:
Sveta_85 [38]3 years ago
6 0

Answer:

Following are the code to the given question:

x= input()#defining a variable x that inputs value from the user-end

l = x.split(" ")#defining variable l that splits the x variable value with a space

t= int(l[len(l)- 1])#defining a variable t that decrease the l length and convert the value into integer

for i in range(1, (len(l) - 1)):#use for loop to calculate the range of the list

      if int(l[i]) < t:#defining if block that checks the list value is lessthan t

          print(l[i])#print list values

Output:

Please find the attached file.

Explanation:

In the above-given code, an "x" variable is declared that inputs the value from the user-end, and use the "l" variable that splits all the value and defined a "t" variable that adds value into the list and convert the value into an integer.

In the next step, for loop is declared that counts the lists and use a conditional statement that checks list value is less than t and use the print the method that prints the list values.  

You might be interested in
Sarah maintains a blog about her soap-making business, and she has hired someone to create a database for this business. She mak
ivann1987 [24]
The database planner would most likely create a table that contains customer contact information since these would be the individuals who placed an order for Sarah's products after visiting her blog. 
4 0
3 years ago
How to cheat on asseeprep
Burka [1]
Just do it just look up the answers mate
6 0
3 years ago
What is an example of a hard skill?
Serjik [45]
3 would be self management
4 0
3 years ago
Read 2 more answers
To create a datetime object for the current date and time, you can use theGroup of answer choicestoday() method of the date clas
SVEN [57.7K]

var theDate = new DateTime (DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, hours, minute, second);

6 0
2 years ago
Who tryna trade in gta my psn is xMadOrNawx-_-
barxatty [35]
Ok I’ll add you to day
5 0
2 years ago
Read 2 more answers
Other questions:
  • An employee is angry with his boss and wants to sabotage the company. To accomplish this he secretly changes some of the values
    7·1 answer
  • True or false words spelling and grammar check is always %100
    7·2 answers
  • AYUDAAA..... DARÉ TODOS LOS PUNTOS QUE PUEDA.
    15·1 answer
  • In project integration management, project ______ and _______ are intertwined and inseparable activities
    14·1 answer
  • Which of the following is not something that consumers need to pay attention to order to make rational choices
    6·2 answers
  • The Linux operating system was created by which software engineer?
    15·1 answer
  • Select the correct text in the passage. George is working as a lead team lead. Which statements correctly describes the skills t
    12·1 answer
  • Who can add entries to value log
    8·1 answer
  • PLEASE ANSWER FAST.one of the barriers for early "talkies" was the need to manually crank the projector and manually synchronize
    13·1 answer
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!