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
What is a computer attack where an attacker accesses a wireless computer network, intercepts data, uses network services, and/or
Harman [31]

Answer:

The correct answer to the following question is Drive-by hacking .

Explanation:

Drive-by hacking is the type of hacking which comes under the cyberterrorism.

Drive-by hacking is the hacking where the hackers can access their data and steal their data, use their network services from some "safe" distance without going inside the company or an organization.

Drive-by download is the type of download of the malicious code into your mobile devices or the computers which occur by designed and it leave you to the cyberattack.

7 0
3 years ago
An adjustable wrench's movable jaw is positioned <br> by​
ki77a [65]
Placing it on top then sliding the dile to close it, can you give me brainlist??
7 0
3 years ago
Explain the following as used in Tally Accounting Software:
vaieri [72.5K]
Business transactions
3 0
3 years ago
What is a text feature that could add visual interest and clarity to a procedural document?
rjkz [21]

Bullet points is another

3 0
3 years ago
Read 2 more answers
Which is missing in most areas that do not have Karst topography?
ikadub [295]
A) Limestone is the correct answer

5 0
4 years ago
Read 2 more answers
Other questions:
  • How to burn mp3 on dvd
    13·2 answers
  • Marcus just created a new folder specifically for his buisness records so he would like to move last months business transaction
    13·2 answers
  • What concerns do you need to have with individuals hacking your information, computer, personal devices, and car? How can you pr
    5·1 answer
  • When you set up a worksheet, you should use cell references in formulas whenever possible, rather than ____ values.
    11·1 answer
  • Which of the following involves writing hidden messages so that only the sender and intended recipient know a message exists? St
    5·1 answer
  • An aerophone is an instrument that causes ________ to vibrate, thus creating sound waves.
    11·2 answers
  • I need help with question 3 I’ll give brainliest
    10·2 answers
  • When writing research questions, use action words, such as
    6·2 answers
  • Video is a medium that's looks real anyways, but is real________________.
    10·1 answer
  • How should work be allocated to the team in a Scrum project?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!