I am in the process of building a list of resources and tasks that can be used to teach / practice coding concepts (and where possible link into other aspects of the curriculum in other subjects) and this is one simple idea that practices quite a lot of different aspects of Python.
In writing a program to calculate the average of a number is inputted numbers, it practices the use to lists, variables, iteration, use of some simple functions (and also use of printing text with variables).
The task that I set my students was as follows:
- Ask the User for how many numbers they need to input (to calculate the average)
- Take the input(s) from the user
- Calculate the average of the numbers
- Print - The total of all the numbers inputted
- Print - all the numbers inputted
- Print - the average of all the inputted numbers
For more gifted students, there is the option for an Extension task: to Calculate and Print out the Highest and Lowest numbers as well (code for this program is shown below):
The files for both programs can be downloaded here