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
# 1) Complete the function to return the result of the conversion
seraphim [82]

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)  <em>        return km</em>

 

return km returns the result of the computation

2)  = <em>convert_distance(my_trip_miles)</em>

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + <em>str(my_trip_km)</em>

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

3 0
3 years ago
What two sets of data does every folder and file on an ntfs partition list?
QveST [7]
Read and execute are the two sets of data
8 0
3 years ago
Suppose as a computer programmer, you have been assigned a task to develop a program to store the sorted data in ascending order
shepuryov [24]

Answer:

In case the data is arranged in the ascending order, you can always change the Binary search tree into a Height BST, and which is also known as the self-balancing BT. And through this, it's quite on hand to better the operations like searching on the new BST. And these SBBTs are quite commonly made use of for constructing as well as maintaining the ordered list. This is the case in the case of the priority queue, and this is what is required here.

Explanation:

Please check the answer.

3 0
4 years ago
5. Something that has a value 2 points<br>is called a/an<br>O<br>NODE<br>POWER<br>O<br>ATOM​
morpeh [17]

Answer:

it's ONPOA

Explanation:

try use a board game by some of the pins or any type that is part of the game and see if that helps out.

6 0
4 years ago
People express more. often through the ___. language than written language
Oxana [17]
Verbal language because somebody's verbal words are more receptive then ones written word
5 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following are incorrect safety precautions for equipment operators? A. Drive equipment or vehicles on grades or roa
    7·2 answers
  • Luentifying message rullidl Upuuns
    12·1 answer
  • Which file type is used for animated images?
    9·1 answer
  • What is the name of the component that allows us to use electrical pulses in a computer?
    8·1 answer
  • Which type of microscope can only be used to view non-living specimens?
    10·2 answers
  • What does a blue painted curb mean?
    12·1 answer
  • Which Windows feature allows secure printing over the Internet?​
    11·1 answer
  • Match the definition
    14·1 answer
  • Choose the term described. : a value that can be passed to a function
    9·1 answer
  • Cryptography is the science of secret writing. Cryptography involves creating written or generated codes that allow information
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!