
Find out what's in the course.
How to get the best out of the course.
How to install Python on your computer.
How to install Microsoft Powershell, a free cross-platform "shell" that will enable you to run Python programs from the console or terminal and install Python packages. This step is optional but recommended.
How to create Python virtual environments, which enable us to ensure we're always using and administering the correct version of Python.
Introducing Visual Studio Code, a free lightweight cross-platform programmer's file editor, suitable for beginners and professionals. This is my favourite editor right now!
It's time to create our first basic 'hello world' program.
Here we'll look at an interesting and very common way to run programs on UNIX-like systems. Even if you're using Windows (where this won't work), it's worth knowing about in case you get a job with Python one day.
All source code is on the widely-used Github.com. Here I'll show you where to find it.
Some tips for using Visual Studio Code.
Variables are one of the most important building blocks of computer programs.
Let's create a program that interacts with the user.
Introducing Python's builtin functions. By the end of the course you'll know how to use nearly all of them.
Here we'll look at handling numbers using variables.
We can create numeric expressions in Python: adding numbers, subtracting, multiplying and so on.
A look at the concept of types and dynamic typing, and we'll look at some common types in Python.
We'll create a little interactive program that performs a simple calculation.
Now we'll write a program that can convert a temperature in Celsius to a temperature in Fahrenheit.
If you can write programs like these after this lecture, you're making great progress.
Take a look at the program you're going to learn to write in this section.
Python allows us to create variables that refer to the values "True" or "False" as well as strings and numbers.
Conditionally executing code with "if"
Choosing alternative code blocks to execute.
Constants are variables that you don't intend to change. Python doesn't really have them, but they're an important concept to understand.
Now we can look at choosing between multiple alternative code blocks to run.
Comparison operators allow us to compare one value with another.
In this video I'll give you an exercise involving writing software to control a hypothetical refrigerator.
Here I'll show you a possible solution to the fridge exercise.
Let's look at some ways we can improve the fridge exercise solution, without using any more advanced techniques just yet.
Loops allow us to execute code repeatedly, and the most important type is the "for" loop.
In this video we'll take a closer look at ranges.
It's time to have a proper discussion of the importance of indentation in Python.
The 'break' keyword is found in many programming languages and here we'll see what it does and how to use it in Python.
"Continue" is also found in many languages and is similar to "break", but different ...
Now it's time for another exercise, this time involving checking a password.
Let's look at a possible solution to the password exercise.
Python enables us to do boolean logic using the so-called boolean operators: and, not and or.
Here I'll give you an exercise with boolean operators.
Let's look at a possible solution to the exercise on boolean operators.
Let's look at a different way we could approach the boolean operators exercise.
"While" loops are used when you want to execute some code repeatedly for an indefinite number of times.
In this video we'll create a really simple function.
Let's take a look at a program that uses multiple functions.
How can we pass values to functions? Find out here.
All objects in Python have a unique ID, which we can obtain using the id() function. This can help give us more insight into how Python works.
In this video we'll take a closer look at how parameters and arguments work.
Return values allow us to get values back from a function.
Let's take a look at how to pass multiple arguments to a function.
Now I'll give you an exercise involving calculating "factorials".
A possible solution to the factorial exercise.
We can supply default values for arguments.
Keyword arguments allow you to name your arguments.
Variable length arguments allow you to pass as many arguments as you like.
We can also create variable length keyword arguments, allowing you to pass as many named keyword arguments as you like.
Let's go over what we've learned about arguments and parameters.
A possible solution to the arguments exercise.
How to return multiple values from a function, and an exercise.
Now we'll look at one possible solution to the BMI exercise.
Tuples are the simplest container type in Python.
It's very easy to turn some values into a tuple, or turn a tuple into some separate values.
Let's take a look at getting values out of tuples via indices.
There are some functions and operators that we can use with tuples.
Lists are an extremely common and useful type, allowing us to create mutable (changeable) lists of objects.
We can join lists together in various ways.
Let's take a look at some ways to change lists.
There's a third slice argument which allows us to specify step size.
Here we'll take a look at inserting items into lists and extending lists with other lists.
Let's look at removing items from lists.
List comprehensions are a very powerful and flexible way to create lists.
We can add conditions to list comprehensions to conditionally include items in the list.
If/else in list comprehensions allows us to change what we add to the list, item by item.
In this video I'll give you an exercise you can try with lists. This is a very common exercise in colleges and universities.
Some tips on how to do the exercise.
Here we'll lay out the structure of a possible solution to the exercise.
Now we can complete the solution to the list exercise.
Sets allow you to store collections of unique items and easily check which items are in the set.
Let's see how we can add items to sets.
We can also remove items from sets.
One of the key benefits of sets is that we can do mathematical set operations with them, like taking the union or intersection.
The difference_update() function allows us to remove items from a set that exist in another set.
Now I'll give you an exercise you can try involving sets.
Let's look at a possible solution to the set exercise.
Dictionaries are basically lookup tables, often known as "maps" in other programming languages.
Let's see how to add items to a dictionary.
Often we want to iterate over all the keys and values in a dictionary. Here's how.
Some dictionary functions actually give us a "view" of a dictionary which can be used to update the dictionary.
Here we'll look at how to delete items from a dictionary.
The get() method of dictionaries allows us to retrieve a value, but specify a default value for if it's not found.
The defaultdictionary() class is a dictionary in which the values have default values. It's very useful.
Of course we can create dictionary comprehensions, like list comprehensions. They're a little bit more tricky though. Let's see how to use them.
Now I'll give you an exercise you can try with dictionaries.
Here's a possible solution to the dictionary exercise.
In this video we'll look at two unrelated things: the casefold() function and the None type. Both can be used to improve the solution to the dictionary exercise.
In this video we'll look at two similar and very useful function, both for iterating over containers.
Now we can use the last few things we've learned to improve the solution to the dictionary exercise.
What are hashing algorithms? These are used all over the place in software programs, including in Python containers.
Let's summarise the different container types.
You may have heard of "Big O" notation. This is a useful concept when deciding which container to use, so we'll take a look at it here.
Now we can move on to creating more complex containers, such as lists of lists.
Let's see how to iterate over a list of lists.
We can also create dictionaries of lists in Python.
Here's an exercise involving dictionaries of sets.
This is the first part of a possible solution to the dictionaries of sets exercise.
Let's complete the dictionaries of sets exercise solution.
Global variables are best avoided, but sometimes you need them, so we'll take a look here.
How can we randomly choose an item from a collection?
Let's take a look at the concept of modular arithmetic, and the mod operator.
An exercise involving containers.
The first part of a possible solution to the containers exercise.
Now we'll finish off the tricky containers exercise.
Let's review what we know about strings at the moment.
A look at one method of incorporating variables into strings.
The format method can help us easily create strings with embedded values.
F-strings are a relatively new addition to Python and usually the best way to embed values in a string.
We can also ensure backslashes don't get interpreted in strings. Here's how.
Let's take a look at a simple regular expression.
How to match multiple characters.
Most programming languages have some kind of "ternary" operator (only one!) and Python is no exception.
Greedy vs. non-greedy matching in regular expressions.
How to match numbers and words.
Capture groups allow us to extract bits of a string using regular expressions.
How to match specific numbers of characters.
Character classes allow us to create our own custom version of a wildcard.
A possible solution to the email address matching exercise..
How to specify what characters you don't want to match in a character class.
About "escaping" in Python regular expressions.
How to use comments and space in regular expressions.
Using references to captured text within regular expressions.
How to use brackets to define text blocks without capturing.
How to match the newline character.
How to specify the end of a line in a regex.
The search function lets us search through strings for a match.
The findall function finds all matches in your text.
How to match the starts of lines.
Splitting strings using regular expressions.
How to change parts of a string.
How to specify alternative possible matches within a regex.
Now I'll give you an exercise on regular expressions (and containers).
The first part of a solution to the budget exercise.
The second part of the solution to the budget exercise.
Ignoring case in regular expressions.
Pre-compiling regular expressions for efficiency.
Specifying what has to follow the bit you've matched in a regex.
Some more regex character match sequences.
A summary of sequences and symbols we can use in regular expressions.
What tracebacks are and how to understand them.
Try-Except: catching errors.
Catching specific exceptions.
Working with error messages.
Raising exceptions.
The slightly unusual KeyboardInterrupt exception.
How to always execute code with try-except blocks..
An exercise using errors.
A solution to the errors exercise.
An exercise involving calculating "pi"
A solution to the pi exercise.
Using assertions to verify your code works as you expect.
How to create classes, and what they are.
Using constructors to automatically run code.
The mysterious 'self' variable.
Associating variables with classes.
Creating string representation of objects.
The important principle of encapsulation.
A simple word game class.
How to choose words in the word game.
Implementing letter-guessing in the word game.
Displaying the word game letters.
Finally we'll complete the word game.
Getters and setters can help with hiding "private" data.
Deriving one class from another class.
How to "override" methods in your subclasses.
An important concept: subtype polymorphism.
How to run superclass constructors.
How to associate properties with a class, rather than with particular objects.
Assigning sequential IDs to objects.
Using class methods.
A closer look at classes and objects.
An exercise to improve your understanding of classes and objects.
Let's get started with a solution to the OO media exercise.
The second part of the media OO exercise solution, and a look at the vars() function.
The third and final part of the OO media exercise solution.
How to create entire hierarchies of classes.
Understand and use multiple inheritance.
What is the diamond problem and how does Python solve it?
Mixins are a slight twist on the usual way of thinking about inheritance.
Using the "property" class to transparently call getters and setters.
Introducing John Conway's "Game of Life"
A hello world GUI desktop app.
Adding frames to your app so you can then add in buttons and other widgets.
Now let's refactor our basic code into a more object-oriented structure.
We can use the grid layout manager to arrange out widgets.
Create a class for drawing on.
How to get the sizes of your widgets.
How to draw cells on the canvas.
Creating a class that represents cells.
Let's make it possible to toggle cells between active and inactive.
How to make stuff happen when you click a button.
How to find the neighbouring cells of a particular cell.
Making cell selections wrap around the edges of the grid.
Now we'll look at the simple rules of the "Game of Life".
Now we can implement the Game of Life rules.
Implement clearing the grid cell selections.
Randomising cell selection.
Creating modules in Python.
How to make sure main() only runs when you want it to.
We can import specific parts of modules rather than the whole module.
How to create packages.
A possible solution to the game package exercise.
Storing functions as values in dictionaries.
A solution to the games menu exercise.
About initialising packages.
Let's investigate how Python actually finds packages.
How to find out what's in a module.
Using packages within packages.
Working with package attributes.
Installing pre-made modules in Python with pip.
This course teaches you computer programming in Python from scratch, and also the basics of machine learning in Python.
With this course you can become part of the Artificial Intelligence revolution.
You'll learn:
How to write programs in Python
The basics of desktop programming in Python
Object-oriented programming and functional programming techniques
How to use machine learning techniques in your code
The basics of visualising and analysing data
Numpy, Pandas, Matplotlib, scikit-learn, Keras and more
Powerful prediction and classification techniques "naive Bayes" and decision trees.
How to use ML techniques to make predictions about data series, spot clusters in data, automatically classify data samples and recognise handwritten digits.
Whether you're a complete beginner with coding or already know some Python or another language, this course can help give you modern computer skills to the point where you could apply for Python jobs, where available.
Python is one of the most popular programming languages today and is especially popular because of its support for machine learning and artificial intelligence.
This courses takes you all the way from writing your first "hello world" Python program to being able to write complex programs incorporating artificial intelligence techniques in which your software can automatically learn how to complete tasks.
I'll type all code right in front of you and explain how it works, breaking down programming and mathematical concepts into simple steps, and with suggested exercises throughout.