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
nlexa [21]
3 years ago
7

In Python, In a program write a function that accepts two arguments: a list, an a number n. Assume that the list contains number

s. 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()

Computers and Technology
1 answer:
Anton [14]3 years ago
8 0

Answer:

#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 value in n_list:

       #Determine if a value is greatter than n.

       # dont know what goes here

       #if so, append the value to the list

       if (value > n):

           larger_than_n_list.append(value)

   #Display the list.

   print(larger_than_n_list)

#Call the main function

main()

Explanation:

The above is the corrected code and it works properly. Some of the errors noted and corrected include:

  • omission of bracket from of main. It should be main()
  • displaying larger_than_n_list as a string instead of a list reference. It should be print(larger_than_n_list)
  • missing if-statement to compare each element in the list with the value in the argument passed.
  • missing call to the display_larger_than_n_list function

A sample image output of the code execution is attached.

You might be interested in
Describe the data update difference between operational and analytical data.
crimeas [40]

Operational data is used to sustain applications that help facilitate operations.

These databases are directed to as application-oriented. Analytical data is used to examine one or more business areas, such as sales, costs, or profit

<h3>What is the distinction between operational and information-analytical systems?</h3>

Operational systems are prepared to deal with the running values of data. Informational Systems deal with the collection, collection, and deriving of information from data.

<h3>What is the distinction between operational and analytical reporting?</h3>

Analytical reporting is introduced toward supporting the strategic and preparing functions of senior management.

Functional reporting is oriented toward helping the day-to-day organizational functions.

To learn more about Operational data, refer

brainly.com/question/22670650

#SPJ4

7 0
1 year ago
What are the modes of operation of WLANs?
Nimfa-mama [501]

Answer:

WLAN's or Wireless LAN Units have 2 main modes of operation

Explanation:

The Two Main modes of Operation are the following

<u>Infrastructure Mode:</u> in this mode the main WLAN unit becomes the main connection point in which all devices are connected to and the main unit provides an internet connection to all the devices connected to it.

<u>Ad Hoc Mode:</u> in this mode devices transfer data from one another back and forth without permission from a base unit.

Some WLAN units will also include 2 extra modes of operation called Bridge and Wireless Distribution System (WDS).

<u>Bridge Mode:</u> this mode allows the base unit to act as an intermediary and bridge two different connection points. Such as bridging a wired connection with a wireless one.

<u>WDS Mode:</u> this mode uses various access points to wirelessly interconnect devices to the internet using repeaters to transmit connections. It can provide internet to both wired and wireless clients.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
A network engineer executes the following command sequence (-i specifies the TTL of the ICMP packet sent):
harkovskaia [24]

The correct option is D. tracert; This sequence emulates is utilities for the command sequence.

<h3>Explain the term command sequence?</h3>

We can complete operations that need numerous phases thanks to sequence, which refers to the order in which commands are processed by a computer.

  • Sequence is indeed a basic algorithm in programming: a series of sequentially carried out logical steps.
  • Network engineers create and implement network setups, address performance issues, monitor networks, and set up firewalls and other security measures.
  • By delivering Internet Control Message Protocol (ICMP) is  echo packet to a target, the TRACERT diagnostic tool ascertains the path to the location.

Thus,  utilities is emulated by this sequence is TRACERT .

To know more about the command sequence, here

brainly.com/question/27703743

#SPJ4

3 0
1 year ago
True or False: The term whitespace speaks to the design of a website
prisoha [69]

Answer:

True

Explanation:

I took the test a little while ago

7 0
3 years ago
Read 2 more answers
The program to check the highEst of n numbercan be done by ......,..
swat32

Answer: Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value.

Explanation: If you need more help follow me on istagram at dr.darrien

-thank you

7 0
3 years ago
Other questions:
  • You just read an msds for acetic acid. based on what you read, what type of information is included in an msds sheet? record you
    7·1 answer
  • What are the pros and cons of editorial anonymity?
    13·1 answer
  • What is the use of ROM chip in computer system?​
    13·1 answer
  • Explain how each of the five types of prewriting assist a writer in getting started. please make it short.
    15·1 answer
  • In which of the security mechanism does the file containing data of the users/user groups have inbuilt security?
    6·1 answer
  • Consider the following method:
    14·1 answer
  • I’ll mark brainlest
    14·2 answers
  • !!!!!16 POINTS!!!!Can a computer evaluate an expression to something between true and false? Can you write an expression to deal
    7·1 answer
  • TO Cloud
    10·1 answer
  • Which very high-speed fiber network was already in place and being used for wide area networking (wan) transmissions, before the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!