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
HELPPP ASAPP
Setler [38]

Answer:

I think that Hardware runs the computer, whereas software performs tasks is correct.

I think that Hardware performs tasks, whereas software provides instructions is correct.

Explanation:

For the first one I put above, I think it is correct because Hardware is literally the computer, it runs everything but the software gives it instructions.

For the second one I put above, I think it is correct because Hardware does what the software tells it, hardware is what makes everything happen, the software gives it code.

For example, if you know Python:

print('Hello')

Will tell the computer to print 'Hello' in the terminal.

If you know javascript:

document.write("Hello") Not sure if this is right btw, I learned js some time ago

This will tell the computer to display Hello on the screen on your website

If you know ok nevermind...

And by software you mean the programming language or something executing the code (complier) right?

Hope this helps!!!

LOOK AT THIS!!!

My guess, might not be correct: Hardware performs tasks, whereas software provides instructions because if software is the app or program right? So then the software gives the code and algorithms and in algorithms you provide instructions and the computer runs the result, if you think about it like this: without the software the hardware can't do anything which is true, so then the software is telling the software what to do (instructions) and the hardware is performing it and showing results and responding to the software. I hope this helps

This is supposed to be a comment but it doesn't fit

6 0
3 years ago
Read 2 more answers
The Mesozoic is known as the _________
oee [108]
Known as Age of the Reptiles.

this might help out

Toward the beginning of the Mesozoic Era there was a depleted ecosystem world-wide. Many of the old life forms had just gone extinct in the Permian<span> Extinction, the world's largest mass extinction. This depleted state was followed by an explosion of new life forms, which included the dinosaurs and mammals, and later in the Mesozoic, the birds and flowering plants. </span>

7 0
3 years ago
The permissions of a file in a Linux system are split into three sets of three permissions: read, write, and execute for the own
Reptile [31]

Answer:

Explanation:

def octal_to_string(octal):

   result = ''

   value_letters = [(4, 'r'), (2, 'w'), (1, 'x')]

   for c in [int(n) for n in str(octal)]:

       for value, letter in value_letters:

           if c >= value:

               result += letter

               c -= value

           else:

               result += '-'

   return result

print(octal_to_string(755))

print(octal_to_string(644))

print(octal_to_string(750))

print(octal_to_string(600))

**************************************************

7 0
3 years ago
Does using interior lighting help improve a drivers visibility at night
marin [14]
No, interior lighting makes less visibility for drivers. It becomes harder to see out the window.
8 0
4 years ago
When using Identify from the IPDE cycle, you are trying to _____.
Thepotemich [5.8K]

B) observe hazards in your environment.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which Internet appliance can take action to potentially stop a network attack from taking place?
    6·1 answer
  • Create a class called Clock to represent a Clock. It should have three private instance variables: An int for the hours, an int
    15·1 answer
  • A(n) ____ web site structure connects web pages in a treelike structure.
    6·1 answer
  • Which features can Danica use to fix the issue
    5·1 answer
  • 9. Ways in which a person or object is influenced by the surrounding environment​
    8·1 answer
  • List the six external peripheral parts of a computer system
    8·1 answer
  • Should the use of hacktivists by a country against enemy organizations be considered an act of war? Why or why not? How about th
    8·1 answer
  • Images are available in many formats, such as tif, bmp, gif, jpeg, and ____.
    5·1 answer
  • enter formula that uses the IF function to test whether the number of years of experience (cell M5) is greater than or equal to
    9·1 answer
  • What is the following file format called? inv_nbr, inv_name, inv_cost 876521,battery,45.00
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!