Programming
Quick links |
Programming |
Data types |
Programming concepts |
Arithmetic operations |
Relational operations |
Boolean operations |
|
Data structures |
Input/output and file handling |
String handling operations |
Random number generation |
Subroutines |
Structured programming |
Robust and secure programming |
Classification of programming languages |
Getting started with Python at Stanground Academy
Virtual box
Session 1 – Introduction to Python
Open the IDLE Python GUI which is the Integrated Development Environment (IDE) (called IDLE after Eric Idle who is a Python).
First, you will have to open “Virtual Box”. You will find it in your “All Programs” Menu under ICT.
There may be a new folder called "Virtual Box" and the version of Virtual Box that you are to load is "Sta-client".
From the new start button in the virtual version of Windows you can select Start – All programs – Python 3.2 and then IDLE.
Using the IDLE in “Interactive Mode”
Open Python as described above and you will see this:
This is the “Python Shell” where you can type in instructions to Python that will be carried out immediately.
Hello World
All programmers start with the program “Hello world”. It’s very much of a rite of passage.
Exercise 1
Copy and run the following program in Python in interactive mode (first Window in IDLE).
print(‘Hello World’) | (case sensitive, as are all commands in Python) |
You will hopefully see the message Hello World as shown below.
![]() |
print (“xxx”) will work as will print (‘xxx’) (N.B. speech marks) |
Exercise 1a
Change the program so that it prints out:
Pleased to meet you
Exercise 1b
Write a program to display using apostrophes rather than speech marks:
This is Paul's first program
The apostrophe makes this trickier than it first may seem.
![]() |
Use a combination of “ and ‘ characters try it and see. Is there a difference? |
Writing Python programs - Session 2 - Using IDLE and Saving Programs
When using the IDE (IDLE) in “Script Mode” IDLE is in effect a word processor for Python programmers. Using “interactive mode” is fine if you want to look at one line programs or use notepad to write programs and copy them into IDLE but for real programs you need to write and save your program and then run it.
Open Python and you will see the IDLE window
Now select File and then select New Window. A new window will open looking just like the one below.
It is slightly different from the interactive window as it is currently untitled and has no Shell menu tab. This window is called a “Script Window” and a new one is opened for each new program you want to write.
Now type into this new window: print (“Hello New World”) and press enter.
Hopefully nothing will happen except the cursor moves to a new line.
Now go to the Run Menu and the select Run Module (you can just press F5 at any time to run your program).
You will be asked to save the program save it into a folder as shown below. You are working in a Virtual computer so take care when you save. If you save to drive C: then when you exit all your work will vanish. Any work lost in this way cannot be recovered so it is up to you to make sure that all your work is saved correctly.
You must select “Computer”
… and then Drive H:
I saved it into a Folder I made in My Documents that I called Python.
Name your files with the name of the exercise that you are attempting so that you can keep a close check on your progress.
Note that the PC is supposed to save it as a type .py this means the PC recognises it as a Python File. When you run Python on your PC at school you will have to add the .py yourself. You will know if you need to do this as your program in IDLE will change from multi coloured to all black if it doesn’t have the correct extension suffix.
Once you have saved it, if necessary press F5 again and the program will run. Below you should see what happens.
Exercise 2a
Try typing in the following program: Remember the syntax is important and be careful when you use capitals. Type in the following
Run the program by using menu: Run – Run Module (or F5.
Save to your Python folder when prompted and you should see what is shown below.
Exercise 2b
Try this, the \n command at any point in a line of text will force a new line:
You should see something like this:
Exercise 2c
Write a program to correctly display the address of the academy in a single line of code.
Writing Python programs - Session 3 - Interactive Programming
We have run some simple programs now we will look at how to make the programs interactive. By interactive we mean making a program wait for a user to input some data and then respond in some way.
The first command we will look at is the “input” command (note; this is still lower case).
Copy in the following program (note; variables are not normally given capital letters in Python e.g. we use name not Name. This is just a convention and has no effect on the way the program runs.)
I have done this below with some comments using the # sign.
Students will be asked to add comments to their programs when you do the controlled assessment. The example below also demonstrates that too many # comments can actually make a program harder to read
Run the program (F5) and when prompted save to your Python Folder; it should look like the example below. I used the name “John” when asked; you can use what you like.
Exercise 3a
Write a program that asks for your favourite type of music and then replies I love {your choice} as well.
e.g.
Exercise 3b
Write a program that asks for your first name, then asks for your last name and finally prints out a greeting including your full name. e.g.
There are two ways to achieve this one uses a blank space “ “ the other involves investigating the difference between using the + (concatenating) and the , to separate the variables. Try both of these now. We will look into the both these methods in more detail in later lessons. Extension: (exercise 3c) get Python to ask for your favourite subject as well.
3.1 Fundamentals of algorithms
- 3.1.1 Representing algorithms
- 3.1.2 Efficiency of algorithms
- 3.1.3 Searching algorithms
- 3.1.4 Sorting algorithms

3.2 Programming
- 3.2.1 Data types
- 3.2.2 Programming concepts
- 3.2.3 Arithmetic operations in a programming language
- 3.2.4 Relational operations in a programming language
- 3.2.5 Boolean operations in a programming language
- 3.2.6 Data structures
- 3.2.7 Input/output and file handling
- 3.2.8 String handling operations in a programming language
- 3.2.9 Random number generation in a programming language
- 3.2.10 Subroutines (procedures and functions)
- 3.2.11 Structured programming
- 3.2.12 Robust and secure programming
- 3.2.13 Classification of programming languages

3.3 Fundamentals of data representation
- 3.3.1 Number bases
- 3.3.2 Converting between number bases
- 3.3.3 Units of information
- 3.3.4 Binary arithmetic
- 3.3.5 Character encoding
- 3.3.6 Representing images
- 3.3.7 Representing sound
- 3.3.8 Data compression

3.4 Computer systems
- 3.4.1 Hardware and software
- 3.4.1 Operating systems
- 3.4.2 Boolean logic
- 3.4.3 Software classification
- 3.4.4 Systems architecture

3.5 Fundamentals of computer networks

3.6 Fundamentals of cyber security

3.7 Ethical, legal and environmental impacts of digital technology on wider society, including issues of privacy
- 3.7.1 Ethical impacts of digital technology on wider society
- 3.7.2 Legal impacts of digital technology on wider society
- 3.7.3 Environmental impacts of digital technology on wider society
- 3.7.4 Issues of privacy

3.8 Aspects of software development

Glossary and other links
