Ex Files in Python
[Link] contains the following numbers. Use this file for all
questions
14
8
23
5
17
42
9
31
6
19
1. Calculate the total: Read all the numbers from [Link] and print their sum.
2. Find the largest and smallest: Read the numbers and print both the maximum
and minimum values in the file.
3. Compute the average: Read the numbers and print the average (mean),
rounded to 2 decimal places.
4. Count numbers above the average: Read the numbers, calculate the average,
then count and print how many numbers are strictly above it. Also print those
numbers on one line.
5. Read [Link], then write a new file called [Link] that contains: the total,
the average (2 decimal places), the highest number, the lowest number, each
on its own labelled line.
6. Count even and odd numbers: Read [Link] and print how many numbers
are even and how many are odd.