subject
Computers and Technology, 25.11.2021 06:00 terry94

Overview Practice using loops, lists, and user-defined functions.
Objectives
Use critical thinking skills to determine how to manipulate lists with a user-defined function and loops. You will be able to practice creating functions, returning values, and using lists with loops.
Description
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, read in those integers. Finally, get the last value from the input, and output all integers less than or equal to that value.
Ex: If the input is:
Enter the number of integers in your list: 5
Enter the 5 Integers:
50
60
140
200
75
Enter the threshold value:
100
the output is
The integers that are less than or equal to 100 are:
50
60
75
The integers that are less than or equal to 100 are:
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
Such functionality is common on sites like Amazon, where a user can filter results.
Your code must define and call the following function:
def output_ints_less_than_or_equal_to_t hreshold(user_values_list, upper_threshold) returns a list of integers from user_values_list that are less than or equal to upper_threshold
Recall that functions may return a value. In the code you created for previous assignments and examples, you retumad one number that was either an integer or a font. You can actually return anything from a function in the same manner. For this lab, you will be returning a list of integers from your user-defined function.
Likewise, you can pass anything to a function, not just numbers and strings. For this lab, you will have to pass a list to your function.
LAB 100 Output values in a list below a user defined amount functions
1 # Define your function here
2
3 if --nane-- '-noin-' :
4
5 #Start the rest of your code here
6

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
How can data be added in a table by using what view
Answers: 1
question
Computers and Technology, 22.06.2019 00:30
Advantages and disadvantages of binary system
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
You know the right answer?
Overview Practice using loops, lists, and user-defined functions.
Objectives
Use cri...
Questions
Questions on the website: 13722367