[Tutor] python calculate number in a text file

Fabian Lunell fabi.lunell at gmail.com
Tue Oct 6 12:10:31 EDT 2020


You can here download
<http://homepage.lnu.se/staff/jlnmsi/python/2020/10000_integers.zip> two
files each containing 10000 integer values. The main difference between the
two files is how the integers are formatted in the file.

Write a program read_numbers.py that reads the two files (one after each
other) and for each file computes and presents the average (mean) value and
the standard deviation. We expect two separate functions mean(lst) and
std(lst) that computes the mean and standard deviation for a given list of
integers lst. Here you can find more information about the standard
deviation <https://www.mathsisfun.com/data/standard-deviation-formulas.html>
.


More information about the Tutor mailing list