Home /
Expert Answers /
Computer Science /
write-a-python-program-named-computeaverage-py-that-reads-in-a-list-of-nonnegative-integers-and-to-pa734
(Solved): Write a python program named computeAverage.py that reads in a list of nonnegative integers and to ...
Write a python program named computeAverage.py that reads in a list of nonnegative integers and to display the largest integer, the smallest integer, and the average of all the integers. The user indicates the end of the input by entering a negative sentinel value that is not used in finding the largest, smallest, and average values. The average should be a value of type double, so that it is computed with a fractional part. Ex. user inputs the following: 10 2 50 100 1 \( -1000 \) (note: The \( -1000 \) is an example of a sentinel value so we stop taking input from the user and we do not use the \( -1000 \) in our computation. Must do this for all negative numbers not just -1000) sample output: Largest integer is 100 Smallest integer is 1 Average of all the integers' is \( 32.6 \) Part 2: Write a python program named oddSum.py that will compute the sum of the first \( n \) positive odd integers using a for loop (note range function may be useful here). For example, if \( n \) is 5 , you should compute \( 1+3+5+7+9 \). So in this case 25 should be outputted. Your code must work for any positive number that is inputted. sample user interaction:
sample user interaction: Please enter a positive integer: 5 The sum of the first 5 possitive odd integers is 25 .