Students will learn to interpret, trace, identify and create Python code that uses:
| Concept | Explanation | Python code | Examples |
|---|---|---|---|
| Output | The computer communicates information to the user. In this course, we use print to output text to the console. |
print("Text goes here") |
print("Hello World!") |
| Strings | The text data type. All string data is treated as text, even if it is numerical characters. | "string goes here" |
"This is a string" |
The slide deck for this topic is on Google Slides, shared with the Variable assignment and Input chapters. A PDF copy is kept on Dodona too.
Each skill has 3 to 4 individual projects associated with it that take students through the PRIMM pedagogical framework. They are numbered to try and make the order obvious. You can assign these one at a time or drip feed as students get to them.
Algorithms - sequences of instructions for a task.
Output - the information presented to the user by the computer. In our programs output will be in the form of text on screen.
Syntax - the format that code is written in. If code is not written in the correct format it creates a syntax error and the program will not run.
This slide deck starts with some theory around input/process/output and what an algorithm is. If you would rather dive straight into the coding then that is fine.
Do not be afraid to slow it down and really ensure that students have mastered these concepts. There are lots of similar tasks available online that you can use to supplement the ones in these resources. I can particularly recommend:
The input/process/output diagram on the lesson slides will be referred back to in future sessions.
It is important to ensure that students understand the difference between algorithm and program.
Once you have explained this we move on to coding output using the print statement. This is one of the simplest commands in Python. It offers instant feedback: users can see if it works or not straight away. When students have had a chance to predict and test, start to explore how to break the statement. This will give you a chance to highlight the importance of precision and correct syntax in programming. I find it really helps if students appreciate this very early on.
print("Text to be output goes here")
print has a capital P