Login

Please fill in your details to login.





lesson 3:1:1 from blocks to text

Graduating to Thonny
Hello and welcome to text-based programming! You have already learned how to think like a programmer using blocks in Key Stage 2. Now, you are going to learn how to write programs like a professional, using a real-world language called Python.

Your New Coding Environment: The IDE


From now on, you'll be using an Integrated Development Environment, or IDE. A popular one for learning Python is called Thonny.

image
The Thonny Interface

An IDE is just a program that bundles all the tools a programmer needs into one place. For us, it has two super-important panels:

The Editor (top panel): This is just like a text editor (like Notepad). This is where we write and save our main program, which is called our source code.
The Shell (bottom panel): This is where our program runs. We will see all our output here (like any text we print), and we can also use it to quickly test single lines of code and interact with our program.

time limit
Task 1 Code Translator
Before we touch the computers, let's prove that you already know how to translate code from block based code like Scratch into Python. In your pairs, your teacher will give you a set of cards. Some show Scratch blocks you already know, and some show the new Python code. Your job is to match the block to the code that does the same thing!

Checkpoint

Your first program


The first command (or function) every programmer usually learns is
print()
. Its job is simple: it tells the computer to display whatever you put inside the parentheses to the shell. When we want to print text, we have to tell Python that it is text. We do this by wrapping it in quotation marks (""). Any text inside quotes is called a string.

image

Try running the following code. Experiment by changing the text inside the quotation marks and see what happens.


Adding Comments


One last thing! Programmers need to leave notes for other humans (and for their future selves) to explain what their code does. We do this with comments. In Python, any line that starts with a hash symbol # is a comment. The computer ignores it completely.

image

Try running the following Python script and notice what happens in the shell.


time limit
Task 2 A Greeting (and how to break it)


Checkpoint
Last modified: September 8th, 2025
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning