It being homework, I'm providing only a few hints
- beware of using
numpy
as suggested in other responses (unless of course your class is about advanced numeric calculations and such, at which case numpy would make sense...)
- using the
csv
module may simplify the parsing of the input file, here again, learning how to do this by hand may be useful.
The two remarks above bring the question of how should Python be used in the context of an intro do programming course? [as seems to be the case here]
Python comes with batteries included, meaning that it provides access to very numerous modules (both "standard" and "add-on") which help tackle the most common (and indeed also some of the most esoteric) needs. The language itself provides many constructs that make various things so easy. The conundrum for the beginner is then to decide whether to learn directly the most "pythonic" way of doing things (by leveraging all these powerful constructs and libraries) or to write things "long hand". It is a balancing act... for sure you should remember that for most tasks there is probably a module [or two] which can greatly help. Often instructors will provide "limits" as to what libraries/modules are allowed.
Going back to the problem at hand...
- the structure of the program would look something like
[pseudo code]
open file
for each line in the file
for each row in the file
parse the numeric values to an array
for each number in the array
sum it up
calculate the mean
for each number in the array # (again, i.e. now that you have the mean, needed for stddev formula)
sum up the stddev factors
calculate the stddev
print results
Now, your turn... ;-)