To access the interactive and most up-to-date version of this course, follow the link at the bottom of this
document.
Getting Started
This Course
Welcome!
This course aims to guide you into programming in Python. It is suitable for all levels of ability and does not
require any prior programming knowledge.
By the end of this course, you will be able to build Python programs that solve problems, create games, and gain
an understanding of concepts within computer science. If you have never programmed before, learning your first
language will introduce you to a new way of logical thinking. It will open the doors to improving your productivity
and automating some of the mundane tasks in your life.
This course will cover:
Getting Python running on your machine
Variables and data types
If statements
For loops and while loops
Data structures (list, dictionaries, tuples, and sets)
Functions
Walkthroughs of coding exercises
Python project suggestions
You Will Need
This course will contain code and exercises. If you wish to follow along and write and run Python programs on
your device, you will need to follow the instructions below. If you prefer, you can skip this step and just read
through the course, but writing code and experimenting is the most effective way to learn programming!
To write and run Python on your machine, you will need:
1. A computer terminal
A terminal is integrated into every computer operating system so there is no need for you to install
anything. There will be instructions to access the terminal later in the course.
Python For Beginners 1
, During this course, the terminal will be used to navigate around your devices file system and execute the
Python programs you have written.
2. The Python programming language
For you to execute Python code, you will need to install Python on your device. It is likely that Python is
not installed on your device. To check whether Python is currently installed on your device and, if not,
install it, follow the steps below.
3. A text editor
To write Python code files, you will need to install a text editor. Follow the steps below to install one of our
recommended editors.
Installing Python
This course will be using Python 3, which was released in 2008 and has replaced the older Python 2. As of the
time this course is written, Python 3.9.2 is the latest release, but any version of Python 3 will be suitable for this
course.
Check Whether Python is Currently Installed
To check whether your system already has Python installed you will need to use your computer's terminal. To
open this on Windows, search for 'command prompt' and open the command prompt app. The terminal should
look like a black window, like the one shown below, within which you can enter text with your keyboard.
Within this console, you can enter commands to try and access Python. There are three commands that can do
this depending on your device's operating system. Try each of the following commands below. If after entering
Python For Beginners 2
, any of these you see Python 3.X.X , where each X is any number, Python 3 is already installed on your device
and it can be accessed through the command you just entered.
python --version
python3 --version
py --version
For example, my system can access Python 3 using the python --version command:
Be aware that seeing Python 2.X.X indicates Python 2 is installed and is accessible through the command you
just entered. Python 2 and Python 3 can be installed at the same time so there is no need to try and uninstall it.
This course will use Python 3, so you can just ignore this Python 2 command and continue checking the other
commands for Python 3.
If none of these commands display Python 3.X.X , follow the instructions below to install Python 3.
Windows
Python for windows can be downloaded from https://www.python.org/downloads/
When following the install setup, ensure that you select 'Add Python 3.X to PATH'.
Python For Beginners 3
, MacOS
Python for MacOS can be downloaded from https://www.python.org/downloads/mac-osx/
Download the installer and follow the instructions.
Linux
Python 3 is often pre-installed on Linux, but if it is not, you can download it with your distribution's package
manager.
On Ubuntu, you can open the terminal and enter sudo apt-get python3
Alternatively, the Python zip can be downloaded from https://www.python.org/downloads/source/
If following these instructions do not work for you, there many YouTube tutorials that can visually guide you
through installing Python on your machine. Search 'install Python' followed by your operating system on
YouTube.
Alternatively, follow the steps in this detailed tutorial here.
Repeat the previous steps to check whether Python has installed successfully and identify the command you
need to access Python 3 on your system. When you get it working, make a note of whether you entered python ,
python3 or py as this will be the command you use to execute Python programs.
Introduction
About Python
Python is a programming language that was created by the Dutch programmer Guido van Rossum in 1991. It
grew and evolved over the years to arrive at Python 3 in 2008, which over the years has grown to become one of
the most popular programming languages.
No single programming language is the 'best'. All programming languages have strengths and weaknesses, and
circumstances where some would excel whilst others may perform poorly.
Python's strengths:
Python For Beginners 4