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
jenyasd209 [6]
2 years ago
8

AP CSP - Write a program that takes 10 random numbers from 1 to 12 inclusively and averages them together.

Computers and Technology
1 answer:
Amanda [17]2 years ago
3 0

Answer:

follows are the correct python code to this question:

import random as r#import random package as r

import statistics as s #import statistics package as s

l= r.sample(range(0,12),10)#defining l variable that use random function to store 10 random numbers

avg= s.mean(l)#defining avg variable for calculate average of l

print('List of random number are: ', l)#print list of random numbers

print("The random number Average is: ", avg)#print average value

Output:

List of random number are:  [4, 10, 6, 0, 3, 5, 1, 7, 11, 2]

The random number Average is:   4.9

Explanation:

In question 1:

In the given code, two packages are imported, which are "random and statistics", in which "random" is used to generate a random number, and "statistics" is used to calculate the average value.

In the code, the "l" variable is used, which uses a random function and store 10 random numbers, and an "avg" variable is defined that calculates the average value. In the last step, the print method is used that print number and its average value.

In question 2:

The given code is wrong because it only calls the "random" method, which is not defined.

You might be interested in
In describing a new problem you are having with your computer, your boss interrupts and states, I had the same problem last week
Anna007 [38]

Answer:

Stereotyping

Explanation:

According to my research on information technology, I can say that based on the information provided within the question it can be said that your boss is exhibiting Stereotyping which could be inhibiting his creative problem-solving approach. Just like in psychology, stereotyping is over-generalized belief about a particular something. Which in this case since his boss saw a similarity in the problem with another problem he previously had, he automatically assumed he knew the cause and how to fix it.

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

5 0
3 years ago
Read 2 more answers
"Most of us know that when we come into a college classroom, we will see desks and chairs, a computer station and a projector. A
gayaneshka [121]
Accessibility... I think
3 0
3 years ago
Help Me Please. I'm Begging you
Luba_88 [7]

Answer:

d and b can't see the last ones answer so im guessing this is what you needed.

Explanation:

8 0
2 years ago
Automatic red-eye reduction settings work best on which type of flash?
zhuklara [117]

Answer:

c

Explanation:

3 0
2 years ago
How do you do this question?
laila [671]

Answer:

(a) 1 to 8

(b) 1 to 6

Explanation:

A "leaf" is a node at the end of a binary tree (in other words, it has no "children").  All other nodes are "non-leaf" nodes.

The smallest number of leaves is 1.  That would be a binary tree that's just a straight line; each node will have only 1 child, until you get to the last node (the leaf).

To find the largest number of leaves, we start drawing a full binary tree.  A complete tree with 15 nodes has 7 non-leaf nodes and 8 leaf nodes.  A full tree with 6 non-leaf nodes can have up to 6 leaf nodes.

6 0
3 years ago
Read 2 more answers
Other questions:
  • The programming interface between an application program and the dbms is usually provided by the
    13·1 answer
  • Which of the following is a basic principle of improvement?
    13·1 answer
  • The alumni development office at your university uses specialized software that can be accessed from two different servers. The
    12·1 answer
  • Explain synchronized plug firing.
    14·1 answer
  • Assuming that all of the table and column names are spelled correctly, what's wrong with the INSERT statement that follows?
    13·1 answer
  • When referring to hard drives, access time is measured in
    11·1 answer
  • 3.29 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-di
    10·1 answer
  • k-means clustering cannot be used to perform hierarchical clustering as it requires k (number of clusters) as an input parameter
    15·1 answer
  • State the function of the <br> BIOS,​
    11·1 answer
  • Is anybody willing to gift me V bucks? Gamer tag: SpiffyPlop
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!