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
Levart [38]
3 years ago
13

Write a program that will find the smallest, largest, and average values in a collection of N numbers. Get the value of N before

scanning each value in the collection of N numbers.
Computers and Technology
1 answer:
lara31 [8.8K]3 years ago
7 0

Answer:

Program to this  question can be defined as below:

Program:

Num=[] #defining an empty list

count = int(input("Enter total number in the elements: ")) #insert total element

s=0 # defining variable s

print('Enter elements: ')#message

for i in range(1, count+ 1): #loop to calculte sum

   val = int(input())#defining val to collect values

   s=s+val; # defining variable and add values

   avg=s/count; #calculate avg  

   Num.append(val) #add values in list

print("Smallest number: ",min(Num))#print Smallest number

print("Largest number: ",max(Num))#print Largest number

print("Average number: ",avg)# print Average

Output:

Enter total number in the elements: 3

Enter elements:  

8

7

1

Smallest number:  1

Largest number:  8

Average number:  5.333333333333333

Explanation:

In the above program first, define an empty list and use a loop to insert all elements in the list, inside the list an "s" variable is used, to add all elements. In the list and another variable "avg" is used to calculates its average value.

  • In the next line, python min and max, which is inbuilt method.
  • These methods use the print method that prints its maximum, minimum, and average number.    
You might be interested in
Crash proof cars... do you have any idea on how to improve this idea
AURORKA [14]
The suspense and reaction time of the car . So for example if a car pulled out suddenly and was about to hit you, you could make the car so it functionally knows how to react
7 0
2 years ago
Read 2 more answers
Lil fun question : burgers or pizza??
Margarita [4]
Pizza. . . . . . . . . . .
6 0
2 years ago
Read 2 more answers
Explain why living things store energy in lipids instead of in carbohydrates
Vedmedyk [2.9K]
Lipids are fat and carbohydrates are used to provide your body with energy so they are always being used
7 0
3 years ago
Professor Gig A. Byte needs to store text made up of the characters A with frequency 6, B with frequency 2, C with frequency 3,
Luden [163]

Answer:

This is not true

Explanation:

The optimal Huffman code is used to encrypt and compress text files. It uses fixed-length code or variable-length code for encryption and compression of data.

The professor's character code is similar to Huffman's variable-length coding which uses variable length od binary digits to represent the word strings. The file size of the text file above is;

= 6 x 1 + 2 x 2 + 3 x 2 + 2 x 2 + 8 x 1 = 28 bits

This would be the same for both cases.

The encrypt would be the problem as the encoded and decoding of the characters B and E may cause an error.

8 0
2 years ago
Because it allows their files to be accessed from any device on the Internet, many users like to back-up their files using ___ s
77julia77 [94]

Answer:

Cloud

Explanation:

Cloud computing is a central form of storing data on a data center, provided online, to provides inexpensive and secure storage facilities and central accessing of document, using any device and accessing the data from anywhere and time.

Data stored in a clients computer system, would have to be transferred to another remote computer by using a portable storage, to share data. Using a cloud service or a database center service, a document can be accessed by a group of users at the same time, in different places, and assures a secure data in the database.

3 0
3 years ago
Other questions:
  • A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
    13·1 answer
  • 1. Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name
    6·1 answer
  • Consider the cement used for the foundation; the bricks and timber used for the walls; and the shingles used for the roof. All o
    5·1 answer
  • Minimalism is a major movement in postmodern art. O True O False
    14·1 answer
  • Can a computer will work more efficiently if you perform disk optimization
    9·1 answer
  • When you collaborate or meet with a person or group online, it is called
    12·2 answers
  • Suppose list1 is an MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code:
    8·1 answer
  • Gigantic Life Insurance is organized as a single domain. The network manager is concerned that dividing into multiple domains to
    15·1 answer
  • SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplie
    13·1 answer
  • Which of these is installed only on Apple smartphones and tablets?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!