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
Tom [10]
3 years ago
10

Write python code that does the following: Ask the user to enter as many as number they want; Then find the sum and the average

of these numbers; Print both results. *Tip- you should use while loop and when the user enters a specific word, they can continue to add another number.
Computers and Technology
1 answer:
Hunter-Best [27]3 years ago
7 0

Answer:

It goes like:

______________________________

#taking inpit for n numbers user wanna enter and save it in a variable n,

n=int(input("Enter the no. of no you want to enter: ")

#While loop after initialising a varaible to make suure the loop runs specific number of times

a=0

sum=0

while a>n:

b=int(input("Enter the number: "))

sum+= a

# printing the sum and average after rounding sum/n upto 2 digits after decimal.

print("sum:", sum, "/naverage:", round(sum/n,2) )

______________________________

You might be interested in
Which of the following is the best name for a history report about World War I?
lyudmila [28]
Most likely D would be good
4 0
3 years ago
Read 2 more answers
Describe an example of a very poorly implemented database that you've encountered (or read about) that illustrates the potential
liraira [26]
I have no clue what you are talking about I am so sorry
5 0
3 years ago
Discuss whether the redundant data should be addressed prior to beginning the wireless network architecture project, in coordina
victus00 [196]

Answer:

Before the project

Explanation:

We must o administrate and elaborate a prioritization about this redundant data, if we started after, we're going to lose a general view about the data, and when we're talking about redundant data always must be prevention and not monitoring, because any network must have redundant data, if we try to fix a network or database with this problem, we could delete delicate data.

4 0
3 years ago
Write programs with loops that compute:
Katarina [22]

Answer:

The programs are written in MATLAB.

(a)

sum = 0;

for i = 2:100  %This for loop starts from 2 and ends at 100

   sum = sum + i;  %This line sums each values of the loop

end

disp(sum); %This command displays the sum at command window

(b)

sum = 0;

for i = 2:100

   sum = sum + i^2;  %This line sums the squares of each values in the loop

end

disp(sum);

(c)

sum = 0;

a = input('Please enter a: ');

b = input('Please enter b: ');

for i = a:b

   if mod(i,2) == 1  %This command checks whether the value in the loop is odd or not

       sum = sum + i;  %This command sums each odd value in the loop

   end

end

(d)

seq = input('Please enter a few numbers with square brackets [] around them: ');

small = seq(1);  %Initialize small

large = seq(1);  % Initialize large

for i = 1:length(seq)  %Iterate over the sequence

   if seq(i) < small

       small = seq(i);  %Decide if the value in the loop is smallest

   elseif seq(i) > large

       large = seq(i);  %Decide if the value in the loop is largest

   end

end

fprintf('The smallest of the inputs is %g,\nThe largest of the inputs is %g.\n',small,large);

6 0
3 years ago
Factors to consider when selecting an operating system to install in a computer ​
dusya [7]

Answer:

what do you want your computer to do, how do you want your computer to look, how fast do you want your computer to run, etc

7 0
3 years ago
Other questions:
  • Which computer device helps you input data in the form of text, numbers, and commands?
    9·1 answer
  • How do you mark somebody the brainliest?
    14·2 answers
  • Computer science
    6·1 answer
  • Write a C# program named InchesToCentimeters that declares a named constant that holds the number of centimeters in an inch: 2.5
    14·1 answer
  • You suspect that an attacker has hidden files on your machine. What Linux command would you use to search for files with a file
    14·1 answer
  • Atoms usually combine with other atoms to form<br> A.elements<br> B.compounds <br> C.nuetrons
    5·1 answer
  • The __________ is a center of Internet security expertise and is located at the Software Engineering Institute, a federally fund
    5·2 answers
  • Assignment 1: silly sentences edhesive
    7·1 answer
  • 111+ 11- 1 <br><br><br>1111+1111<br><br><br><br><br>1101 +1101<br><br><br>1010-11​
    10·2 answers
  • The ________ networks operate close to the legitimate free hotspots and typically provide stronger signals
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!