answer.
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
Anna71 [15]
2 years ago
4

Define a function below called average numbers. The function takes one argument: a list of numbers. Complete the function so tha

t it returns the average of the list of numbers. An empty list should have an average of zero.
Computers and Technology
1 answer:
Aleonysh [2.5K]2 years ago
4 0

Answer:

def average_numbers(lst):

   if len(lst) == 0:

       return 0

   else:

       total = 0

       for number in lst:

           total += number

       return total / len(lst)

Explanation:

Create a function called average_numbers that takes one parameter, lst

If the lst is empty, return 0.

Otherwise, add the numbers in the lst to the total using a for loop. When the loop is done, calculate and return the average, divide sum by length of the lst to calculate the average

You might be interested in
A school principal trying to find out if parents will help buy new playground equipment shows digital leadership by.
ELEN [110]

Answer:

D. is the correct answer!

8 0
2 years ago
Read 2 more answers
Identify the correct XHTML syntax for inserting an image as a hyperlink from the options provided. A. book.gif B. C. D.
mariarad [96]

Answer:

The Correct syntax for inserting an image as hyperlink is given in explanation section

Explanation:

To make an image act as a hyperlink, place the image element within the HTML anchor "<a></a>"  element.

The syntax of inserting image hyperlink in XHTML is given below.

<a href = "link_that_can_be_accessible"><img src="source of image" alt="display name if image not shown in the browser" border="0"/></a>

for example lets insert image as hyperlink

<a href="ajax.html"><img src="logo.gif" alt="AJAX" border="0" /></a>

The default appearance is a blue border around the image. Specifying border="0" removes the border around the image.

if you want to insert image from another folder then the image hyperlink looks like this:

<a href="ajax.html"><img src="/images/html5/logo.gif" alt="AJAX" border="0" /></a>

If you want to insert image from another server then image hyper link looks like this:

<a href="ajax.html"><img src="https://www.myExample.com/images/html5/logo.gif" alt="AJAX" border="0" /></a>

4 0
2 years ago
4.9 Code Practice: Question 3
Zanzabum

total = 0

for x in range(99, 0, -1):

   total += x

   print(total)

I hope this helps!

6 0
2 years ago
Read 2 more answers
In Section 8.5.4, we described a situation in which we prevent deadlock by ensuring that all locks are acquired in a certain ord
ruslelena [56]

Answer:

See Explaination

Explanation:

Separating this critical section into two sections:

void transaction(Account from, Account to, double amount)

{

Semaphore lock1, lock2;

lock1 = getLock(from);

lock2 = getLock(to);

wait(lock1);

withdraw(from, amount);

signal(lock1);

wait(lock2);

deposit(to, amount);

signal(lock2);

}

will be the best solution in the real world, because separating this critical section doesn't lead to any unwanted state between them (that is, there will never be a situation, where there is more money withdrawn, than it is possible).

The simple solution to leave the critical section in one piece, is to ensure that lock order is the same in all transactions. In this case you can sort the locks and choose the smaller one for locking first.

4 0
2 years ago
Mitchell is assisting her teacher in a project by entering data into the spreadsheet. Which types of data can Michelle enter in
Rainbow [258]

Hello, Paper, types of data that Michelle can enter into a cell is,

• Data – values, usually numbers but can be letters or a combination of both.

• Labels – headings and descriptions to make the spreadsheet easier to understand.

• Formulas – calculations that update automatically if referenced data changes.

Hope this helped!

4 0
2 years ago
Read 2 more answers
Other questions:
  • The term load is often used to describe opening a page in a ____. Answer
    11·1 answer
  • In an ethernet network, the signal that is sent to indicate a signal collision is called a ________ signal.
    7·1 answer
  • In the middle of the iteration, how should a team handle requirement changes from the customer? (1 correct answer)
    7·2 answers
  • Consider a router that interconnects three subnets: subnet 1, subnet 2, and subnet 3. suppose all of the interfaces in each of t
    11·2 answers
  • An administrator has initiated the process of deploying changes from a sandbox to the production environment using the Force IDE
    5·1 answer
  • Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles
    5·1 answer
  • Which of the following provides a suite of integrated software modules for finance and accounting, human resources, manufacturin
    15·1 answer
  • Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
    11·2 answers
  • Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example
    6·1 answer
  • Pls help!! which of the following is not a step required to view a web page?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!