Answer:
The program in Python is as follows:
def get_user_values():
user_values = []
n = int(input())
for i in range(n+1):
inp = int(input())
user_values.append(inp)
output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])
def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):
for i in user_values:
if i <= upper_threshold:
print(i,end=" ")
get_user_values()
Explanation:
This defins the get_user_values() method; it receives no parameter
def get_user_values():
This initializes user_values list
user_values = []
This gets the number of inputs
n = int(input())
This loop is repeated n+1 times to get all inputs and the upper threshold
<em> for i in range(n+1):</em>
<em> inp = int(input())</em>
<em> user_values.append(inp)</em>
This passes the list and the upper threshold to the output..... list output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])
This defines the output.... list
def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):
This iterates through the list
for i in user_values:
If current element is less or equal to the upper threshold, the element is printed
<em> if i <= upper_threshold:</em>
<em> print(i,end=" ")</em>
The main method begins here where the get_user_values() method is called
get_user_values()