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
Give me the answers to all the tasks
enot [183]
Task one; Immersion and Interaction are most important for virtual reality to provide a smooth and enjoyable experience for the user

For task two the multiple choice on slide 5 has the answers to the quiz
5 0
2 years ago
If cos 3/5 what is the sin and tan​
suter [353]

Answer:2.988584094

Explanation:

6 0
3 years ago
java The maximum-valued element of an integer-valued array can be recursively calculated as follows: If the array has a single e
adoni [48]

Answer:

see explaination

Explanation:

MaxArray.java

public class MaxArray{

public static void main(String[] args) {

int a[] = {1,2,5,4,3};

int max = max (a, 5);

System.out.println("Max value is "+max);

}

public static int max (int a[],int size){

if (size > 0) {

return Math.max(a[size-1], max(a, size-1));

} else {

return a[0];

}

}

}

Output:

MaxArray

7 0
3 years ago
Which sentences use antonyms to hint at the meaning of the bolded words? Check all that apply.
Leto [7]

Answer:

dunno

Explanation:

7 0
2 years ago
Introduction to Programming Workbook
Lapatulllka [165]
Haije jiôes 1w mòé si aimx
3 0
3 years ago
Other questions:
  • Vivian wants to increase the storage capacity of her computer. Which components should she upgrade?
    7·1 answer
  • Which action will help you protect data in your computer in case of an earthquake?
    7·2 answers
  • Please help!! will fan and medal
    12·2 answers
  • During prereading, it is not important to pay attention to visual aids.<br> T f
    15·2 answers
  • Is it safe to tape down cords such as internet cables to the floor?
    14·1 answer
  • Cuales son las caracteristicas de los celulares
    9·1 answer
  • Debevec mentions using the technology he described to animate entire human bodies. Discuss why you think this is or is not a goo
    13·1 answer
  • Define a query that uses the Natural Join command to join three tables to produce useful information.
    14·1 answer
  • what is the term for software that is exclusively controlled by a company, and cannot be used or modified without permission?
    6·1 answer
  • 40 points
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!