Background
This introductory coding project, using Python 3 as a simple word-processor, builds on the success of the Literacy from Scratch model. It encourages the development of (very) short story-writing at KS2 or KS3 (ages 10 to 12 years). These stories are then created using Python 3, and in doing so, a series of elementary coding concepts is developed. These are listed later.
This introductory coding project, using Python 3 as a simple word-processor, builds on the success of the Literacy from Scratch model. It encourages the development of (very) short story-writing at KS2 or KS3 (ages 10 to 12 years). These stories are then created using Python 3, and in doing so, a series of elementary coding concepts is developed. These are listed later.
Students at secondary school level in the UK are required to be familiar with two computer programs. This frequently involves learning coding through Scratch, a visual coding program, often started at primary level as the first required program. Python, a more powerful text-based language, is often added at lower secondary level (ages 11 to 14) but could be introduced in Year 6…
Students at secondary school level in the UK are required to be familiar with two computer programs. This frequently involves learning coding through Scratch, a visual coding program, often started at primary level as the first required program. Python, a more powerful text-based language, is often added at lower secondary level (ages 11 to 14) but could be introduced in Year 6…
Python is widely used in industry, powering:
Python is widely used in industry, powering:
- Google (YouTube)
- Google (YouTube)
- Facebook
- Facebook
- Dropbox
- Dropbox
- Yahoo
- Yahoo
- NASA
- NASA
- IBM
- IBM
- Mozilla
- Mozilla
And so it is very cool…
And so it is very cool…
The process
The process
In English lessons, students in Years 6 or 7, write a very short story which includes some dialogue. This story is then taken to the computer room, where, using Python 3, it can be reworked in the Idle programming window, and printed out in the Shell window as an elementary Python program. This model therefore adds creative and cross-curricular elements to the coding process. Teachers could also add many more mathematical concepts into the stories, as well.
In English lessons, students in Years 6 or 7, write a very short story which includes some dialogue. This story is then taken to the computer room, where, using Python 3, it can be reworked in the Idle programming window, and printed out in the Shell window as an elementary Python program. This model therefore adds creative and cross-curricular elements to the coding process. Teachers could also add many more mathematical concepts into the stories, as well.
The coding in Python
The coding in Python
Output
Output
Notes:
Notes:
1. This story, and all of the coding above, was written in four short sessions by a Year 6 student, who had not seen Python before. See Resources below.
1. This story, and all of the coding above, was written in four short sessions by a Year 6 student, who had not seen Python before. See Resources below.
2. Comparison might usefully be made between Python and the historically more recent Scratch programs.
2. Comparison might usefully be made between Python and the historically more recent Scratch programs.
Teaching suggestion:
Teaching suggestion:
Place the two windows side by side on the White Board, as this allows for discussion of the comparison between the Shell window (program output on the left, below) and the coding window (on the right).
Place the two windows side by side on the White Board, as this allows for discussion of the comparison between the Shell window (program output on the left, below) and the coding window (on the right).
Coding
Coding
The coding process involves learning the following elementary concepts:
The coding process involves learning the following elementary concepts:
- Function: print in purple text (above right)
- Function: print in purple text (above right)
- Output (blue text) and input (in the coding window)
- Output (blue text) and input (in the coding window)
- Strings: the green text of the story is written out in strings between speech marks
- Strings: the green text of the story is written out in strings between speech marks
- Tables (in this case, the 7 times table, and others. Just type a different number!)
- Tables (in this case, the 7 times table, and others. Just type a different number!)
- Variables (choosing which table is to be printed out)
- Variables (choosing which table is to be printed out)
- Range: how long the times table is to run for (up to 12 calculations in this case)
- Range: how long the times table is to run for (up to 12 calculations in this case)
- As well as accuracy in coding, with spaces, brackets, speech marks, blank lines () and so on
- As well as accuracy in coding, with spaces, brackets, speech marks, blank lines () and so on
I think this is enough as an introduction…
I think this is enough as an introduction…
Resources
Resources
- Highly recommended Python videos (introducing the Python Idle editor) by Dr. Ann Dawson
- Highly recommended Python videos (introducing the Python Idle editor) by Dr. Ann Dawson
- Coding for Beginners using Python (Usborne) Includes Python games and a useful Glossary
- Coding for Beginners using Python (Usborne) Includes Python games and a useful Glossary