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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
You know the right answer?
In python, in a program write a function that accepts two arguments: a list, an a number n. assume...
Questions
question
Mathematics, 03.10.2021 07:10
question
Mathematics, 03.10.2021 07:10
question
Arts, 03.10.2021 07:10
question
Mathematics, 03.10.2021 07:10
Questions on the website: 13722359