subject

In Python, In a program write a function that accepts two arguments: a list, an a number n. Assume that the list contains numbers. The function should display all of the numbers in the list that are greater than the number n. Here is what I have so far.

#call the main function
def main:
#declares local variables
number = 5
number_list = [1,2,3,4,5,6,7,8,9,10]
#displays the number
print('Number', number)
#displays the list of numbers
print('List of numbers:/n', number_list, sep='')
#Display the list of numbers that are larger
#than the number
print('List of numbers that are larger than',\
number, ':', sep='')
#Call the larger_than_n_list function,
#passing a number and number list as arguments.
display_larger)than_n_list(number, number_list)
# The display_largger_than_n_list function acceps two arguments:
#a list, and a number. The function displays all of the numbers
#in the list that are greater than that number.
def display_larger_than_n_list(n, n_list):
#Declare an empty list
larger_than_n_list = []
#Loop through the values in the list.
for valie in n_list:
#Determins if a value is greatter than n.
dont know what goes here
#if so, append the value to the list
larger_than_n_list. append(value)
#Display the list.
print("larger_than_n_list")
#Call the main function
main()

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
Answers: 1
You know the right answer?
In Python, In a program write a function that accepts two arguments: a list, an a number n. Assume t...
Questions
question
Mathematics, 20.09.2020 02:01
Questions on the website: 13722360