Assignment 1

Due on Sunday 30th June (11pm-ish)

Plan and think out carefully before you start programming. The point of this question is to get you to be able to write a very slightly non-trivial program in Python and become at least a little comfortable with the programming environments.

Question 1:

Write a program which will ask the user to enter a collection of numbers at the keyboard, and then analyse those numbers. The 'analysis' will comprise finding the max and the min of the collection of numbers, as well as their mean* and standard deviation*. (Please don't simply use the inbuilt Python functions for these computations -- you should use this question to gain practice in performing simple calculations directly.)

* The mean, m, of a list of numbers, (a1, a2, a3, ..., an), is the average, ie   m = (a1 + a2 + ... + an) / n
and the standard deviation, s, is the square root of the average of the squares of their differences from the mean, ie  
s = the square root of ( (a1 - m)^2 + (a2 - m)^2 + ... + (an - m)^2 ) / n.

Question 2:

Write a program inviting a user to enter many lines of text at the keyboard, then have your program create several lists, with each list containing all the words of the same length (so there'd be a list of all the words of length 1, another list of all the words of length 2, etc.), then output to the screen a clear statement of how many words there were of each length. (We might enhance this program later, so do try to make sure that your program is organised cleanly.)