Python3 Tutorial: Python Online Course
Python 3 green and yellow

Python3 Tutorial

Those who want to learn Python ask themselves quite often: "Which version should I use?" If you are free to choose, i.e. if there are no restriction by previous code or company standards, we think you should start with Python3. So, please go on with this tutorial, which is meant to be a tutorial for beginners and programmers switching from other programming languages to Python.

It's an introduction into Python for beginners and intermediate learners with lots of examples and exercises! It's suitable and meant for self-study.

This online Python course was created and is maintained by Bernd Klein, an experienced Python trainer, giving training classes all over the world.

News

October 2017:
In our chapter on Polynomials we demonstrate how easily and beautifully a class for the creation and manipulation of polynomial functions can be written in Python.

January - March 2017:
We extended our chapters on Generators and Decorators

May 2016:
New chapter on Decorators. In combination with our chapter on Memoisation and Decorators it belongs to the most extensive treatisises on the topic of decoration à la Python!

December - March 2016:
We wrote four chapters dealing with abstract classes as a tutorial on Metaclasses:

August 2015:
We added a chapter on Slots and another about the difference between type and classes.

July 2014:
An introduction into using database interfaces in Python for SQL, MySQL and SQLite

March 2014:
We are currently completely revising the chapter on object oriented programming. It's more or less complete rewrite. The old version dealing with OOP can still be accessed, though we recommend to work through the new ones.
The topic now comprises five instead of previously only one chapter:

Any Help is Welcome!

Though we do our best to prevent errors, we need your help to ensure that all the information presented in this tutorial is correct and up to date. If you find spelling and grammatical errors, it will be great if you will point them out to us, so that we can fix them! We are continually improving this website and this will assist us in making it the best tutorial! The same is true of course, if you find logical problems or errors in the text or the code examples. We hope that there are only few of them left in the text! But as the saying goes, nobody is perfect! Please use the contact button!

Ads for training classes

This website is ad-free! There are no paid-for ads. The only things advertised here are the book by Bernd Klein, the author of this tutorial, and the training classes given by the author.

Tutorial in hard copy

There is no PDF version available, but you can create it yourself. You can use the print functionality of your browser to do this. Use "Print to File" and you will get a nicely formatted version of a chapter.

Thanks!

Thank you very much for using this tutorial! We hope that you will enjoy learning Python with us!

Advanced Topics

System Programming with Python
Python has various modules to support system focused programming. The sys module is introduced in the first chapter. A focal point are the data streams (stdin, stdout, stderr) and redirections of streams. The interaction between is the focus in the following chapter of our course.
The interaction between Python and the Linux Shell is another topic of our advanced section. This chapter is followed by Forks and Forking.

You can learn more about threads and threading in our Introduction into Threads. We show how to find the active IP addresses in a local network by using forks.

We demonstrate in "Pipe, Pipes and '99 Bottles of Beer'" how to write a program which is construing the famous American song "99 bottles of beer" by using forked processes and Pipes. So, if you need a good example of pipes and forks working together you will find it here.
Graph Theory
We have three chapters dealing with Graphs.
  • A general introduction into the Graph theory and the corresponding Python code can be found in "Graphs in Python" You will also here the implementations of a graph class with essential functionalities for graph creation, manipulation and calculations.
  • Introduction into the module pygraph
  • Introduction into the module NetworkX
Computer Science and Computer Linguistics
Finite State Machines are not only used in computer science but in natural language processing as well. We cover the concept of the Finite State Machine in great detail, so that even an amateur in Computer Science can understand the examples. At least we hope so.

Alan Turing's Turing Machines and above all the underlying theory is a must for every computer scientist. We show a simple implementation of a Turing Machine.

If you are interested in Classifying documents, the Introduction into Text Classification using Naive Bayes and our Python Implementation of Text Classification will be the right chapters for you.
Numerical Computations with Python
If you want to get efficient and fast results with arrays and matrices, the NumPy module of Python is definitely the right tool collection for you. You will find answers to your questions in our tutorial, i.e. in our chapters "NumPy Module" and "Matrix Arithmetic".

We also provide an introduction into Linear Combination
Music
It's also possible to create scores with Python: You can find a complete working example in Creating Musical Scores With Python

If you feel that the above topics are to complicated or sophisticated for you, you might like our course for beginners in Python. You find a documented link list in the following lines:
Databases with Python
An introduction into using database interfaces in Python for SQL, MySQL and SQLite
"Games"
What you find are not real games! We show a recursive solution to Towers of Hanoi and a game Cows and Bulls better known in a commercial version called "Mastermind".

Classroom training Courses

This tutorial is, as we have already mentioned, intended for self-study! But some people need to learn Python very quick or prefer to learn in a classroom with an experienced trainer. You may consider visiting one of the courses by Bernd Klein, the author of this tutorial.

Our next Training Courses


Our next open Python classes with Bernd Klein, the author of this website:

Amsterdam:


Python Intensive Course:
    9th of Jul - 13rd of Jul , 2018
Python Course: Level II:
    3rd of Sep - 7th of Sep , 2018

Berlin:


Python Intensive Course:
    11st of Jun - 15th of Jun , 2018
Python Course: Level III:
    14th of May - 18th of May , 2018
Python Text Processing and Computer Linguistics Course:
    15th of Oct - 19th of Oct , 2018
Django Python Web Application Framework Course:
    18th of Jun - 22nd of Jun , 2018
Python Course for Data Analysis and Machine Learning:
    22nd of Oct - 26th of Oct , 2018

Hamburg:


Python Intensive Course:
    12nd of Nov - 16th of Nov , 2018

Lake Constance / Zurich:


Python Course: Level III:
    10th of Dec - 14th of Dec , 2018
Python Course: Extending and Embedding:
    5th of Nov - 8th of Nov , 2018
Python Intensive Course:
    9th of Oct - 13rd of Oct , 2017
    19th of Feb - 23rd of Mar , 2018
Python Text Processing and Computer Linguistics Course:
    15th of Oct - 19th of Oct , 2018
Python Course for Data Analysis and Machine Learning:
    25th of Jun - 29th of Jun , 2018

London:


Python Intensive Course:
    9th of Jul - 13rd of Jul , 2018
Python Text Processing and Computer Linguistics Course:
    15th of Oct - 19th of Oct , 2018

Luxembourg / Brussels:


Django Python Web Application Framework Course:
    18th of Jun - 22nd of Jun , 2018
Python Intensive Course:
    19th of Feb - 23rd of Mar , 2018
    11st of Jun - 15th of Jun , 2018
Python Course: Extending and Embedding:
    5th of Nov - 8th of Nov , 2018

Milan / Mailand:


Python Intensive Course:
    9th of Jul - 13rd of Jul , 2018
    15th of Oct - 19th of Oct , 2018

Munich / München:


Python Intensive Course:
    11st of Jun - 15th of Jun , 2018
Django Python Web Application Framework Course:
    18th of Jun - 22nd of Jun , 2018

Paris:


Python Intensive Course:
    9th of Jul - 13rd of Jul , 2018
Python Text Processing and Computer Linguistics Course:
    15th of Oct - 19th of Oct , 2018

Toronto:


Python Intensive Course:
    9th of Jul - 13rd of Jul , 2018
    15th of Oct - 19th of Oct , 2018

Vienna / Wien:


Python Course: Level II:
    3rd of Dec - 7th of Dec , 2018
Python Intensive Course:
    11st of Jun - 15th of Jun , 2018