Pyhton on the Portal

On your course, you may come across some elements of coding. One of our current students, Sam West, has put together an introductory course on Python to help you get familiar with some of the basics, and beyond.

Python is a programming language, developed in 1991. Whilst it can be used by computer scientists for web and software development, it can also be used by material scientists and engineers for data analysis and performing complex calculations.

As you explore python, you may realise that some websites refer to the difference between Python 2 and Python 3. This course uses Python 3 because it is the most up to date version of python but be aware that some online python resources use python 2 which is slightly different.

It is also important to note that there are often multiple ways of coding the same outcome in python, so don’t worry if your code doesn’t look exactly like the code in my screenshots. It is just important to remember to thoroughly test your code to ensure that it works for all outcomes.

This course walks you through the basics of Python, with a number of examples for you to work through on your own. It is broken down into the following sections:

Each section has a number of slides with green backgrounds. These slides contain exercises for you to have a go at. The final further examples section contains five further exercises for you to complete. These encompass and combine skills from the previous seven sections.

Taking Python Further


This course covers just a basic introduction to python. However, there are plenty of opportunities to take your python skills further:

Python Basics.pdf

Python: The Basics

Python Functions.pdf

Python Functions

Python Lists.pdf

Python Lists

Python Control Flow.pdf

Python Control Flow

Python Loops.pdf

Python Loops

Python Modules _ Importing Data.pdf

Python Modules and Importing Data

Plotting Data and Linear Regression.pdf

Plotting Data and Linear Regression

Further Examples.pdf

Further Examples