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]
3 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]3 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
01000100 01101111 00100000 01111001 01101111 01110101 00100000 01101011 01101110 01101111 01110111 00100000 01111001 01101111 01
Anna71 [15]
This was quite tricky but, I found a program online that answers your question. The answer is (Do you know your binary code? Answer this in binary code)
5 0
4 years ago
Read 2 more answers
Ashley is the record keeper for a bookshop. She gathers and maintains an organized collection of information. What is Ashley usi
maks197457 [2]

The answer is Database.

Reason being is because because the definition of database matches the statement.

- Collection of information that is organized so that it can be easily accessed, managed and updated. 

3 0
3 years ago
Read 2 more answers
Bob flys a drone which has a 20 megapixel camera attached, what is the definition of "megapixel in this context? Why does it mat
Verizon [17]

Answer:

megapixel refers to the unit of resolution i.e. one million

Explanation:

Interestingly the higher the pixels does not mean higher quality of image, it's more about the camera and it's sensor.

I am a photographer and a licensed drone pilot and have researched the subject to help with camera choice, both DSLR and drone.

5 0
3 years ago
Air bags expand at up to __________ mph. A. 70 B. 100 C. 150 D. 200
almond37 [142]
Airbags expand
D. 200 mph
7 0
3 years ago
An administrator helps a user obtain an Internet connection through connecting a laptop with a smartphone via a cable. What has
frez [133]
The administrator set up tethering
8 0
3 years ago
Other questions:
  • To save the changes to the layout of a table, click the Save button on the _____.
    13·1 answer
  • If you need help with a topic that isn't present in English or math labs, what should you do?
    13·2 answers
  • Which option of the Auto Correct tool enables you to add and delete words that do not follow abbreviation rules?
    11·2 answers
  • In JavaScript, which of the statements below can be used for string declaration?
    11·1 answer
  • The good example of pivoting is changing thedimensions along the axis.? True? False
    9·1 answer
  • 1.Customer service is assistance provided by a company to the people who buy or use its products or services.
    13·2 answers
  • You’re browsing the internet and realize your browser is not responding. Which of the following will allow you to immediately ex
    11·1 answer
  • Which of the following is an electronic device, operating under the control of instructions stored in its own memory, that can a
    6·1 answer
  • How much heat is needed to raise the temperature of 7g of water by 15oC?
    6·1 answer
  • <img src="https://tex.z-dn.net/?f=%20%3Cmarquee%20behavior%3D%E2%80%9Dscroll%E2%80%9D%20direction%3D%E2%80%9Ddown%E2%80%9D%3EFol
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!