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
Which two statements about using leased lines for your wan infrastructure are true? (?
Karo-lina-s [1.5K]
<span>The following statements are true: 1. Leased lines require little installation and maintenance expertise. ( A high service quality is offered by point-to point system) 2. Leased lines provide highly flexible bandwidth scaling. (This Allows a Constant availability)</span>
7 0
3 years ago
For the best night photographs, you’ll need to have a camera with a shutter speed of about 3 to 30 seconds
Alex_Xolod [135]
What are you trying to ask?

8 0
3 years ago
What are the two most important network-layer functions in a datagram network? what are the three most important network-layer f
PIT_PIT [208]
1. Datagram-based network layer: Forwarding, Routing.
2. VC- based network layer: Forwarding, Routing, Call setup.
7 0
4 years ago
A swimmer covers 180m in 20 seconds. How many metres does she swim in one second?​
dezoksy [38]

Answer:

9 meters per second

Explanation:

180/20= 9

4 0
3 years ago
Aol Mail Login ☏ 805~365~6444 ☏ Aol Login Mail Aol Mail Login sign ✍✍ USA ✍✍
svet-max [94.6K]

Answer:

Same

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • _____ is published by the U.S. Bureau of Labor Statistics. It provides up-to-date career outlook information. It is no longer av
    15·2 answers
  • In which area of engineering does material selection play a vital role a design optimization b forensic engineering c mechanical
    6·1 answer
  • Which of the following is not a good use of a spreadsheet?
    5·1 answer
  • Derek has an interest in designing video games. What requirements should he fulfill to be a game designer?
    11·1 answer
  • To get started with stock trading and to learn, many people start with this method to learn the ropes and practice with fake mon
    13·1 answer
  • Technology can help governments handle economic emergencies, such as the reliance on automation. Crop and resource shortages. Th
    15·2 answers
  • Yeoo check dis out!!!!!! wait my full vid dont show hol on
    7·2 answers
  • Write the program of while loop .<br>​
    15·2 answers
  • Which practice enables recovery of accidental deletions in data records?
    11·1 answer
  • Relational operators allow you to ________ numbers
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!