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
The CPU converts into information. The CPU is the mastermind of the computer, controlling everything that goes on through a seri
Harman [31]

Answer:

Mathematical sequences

Explanation:

Just did it

5 0
3 years ago
Read 2 more answers
Where is NumPy used?
Svetradugi [14.3K]

Explanation:

The ndarray (NumPy Array) is a multidimensional array used to store values of same datatype. These arrays are indexed just like Sequences, starts with zero.

7 0
3 years ago
Read 2 more answers
How to turn off location on iphone without person knowing
andrezito [222]

Answer:

airplane mode

Explanation:

5 0
2 years ago
Write a Python program to convert temperatures to and from celsius, fahrenheit.
Rudiy27

Answer:

https://www.w3resource.com/python-exercises/python-conditional-exercise-2.php

3 0
2 years ago
Show the steps of a Selection Sort for the numbers ( 5 3 9 5 ).
Sedbober [7]

Answer:

Sorted array will be:-

3 5 5 9

Explanation:

In Selection Sort algorithm it sorts the array by repeatedly finds the minimum in the array form the array that is unsorted and swaps it with the value at the first position.

The unsorted array:- 5 3 9 5

In first iteration

minimum is 3.

3 will be swapped with 5.

Now the array is 3 5 9 5

sorted array 3

In second iteration

unsorted array is 5 9 5

sorted array 3 5

and the minimum from it is 5

No swapping will occur.

In third iteration

unsorted array is 9 5

minimum is 5

sorted array 3 5 5

swap it with 9.

Now the array is sorted.

3 5 5 9

3 0
3 years ago
Other questions:
  • How do humans feel about being abducted?
    12·2 answers
  • In which step of web design is storyboarding helpful?
    14·1 answer
  • Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two indivi
    15·1 answer
  • Which statement correctly compares blank presentations and themed presentations?
    12·2 answers
  • Declare an ArrayList of Strings. Add eight names to the collection. Output the Strings onto the console using the enhanced for l
    9·1 answer
  • A small company with 100 computers has hired you to install a local area network. All of the users perform functions like email,
    9·1 answer
  • Which of the following popular presentation software items do you have to purchase in order to use?
    11·2 answers
  • Data ____ refers to the accuracy of the data in a database
    9·1 answer
  • The Binder Prime Company wants to recognize the employee who sold the most of its products during a specified period. Write a qu
    12·1 answer
  • By what decade were books readily available to the public across the United States and Europe?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!