2. Getting started

A general introduction to programming using Python.

Goal

General introduction to programming using Python. While motivated by writing software for scientific data analysis, the contents as such are much more generally applicable.

The first section, Hello world, starts with a classic of learning programming in any language, printing out “Hello world!”. However, it takes you all the way from the command line to functions, classes, packages, and tests.

Next, we’re looking into fundamentals of programming languages such as syntax, types, and structures (conditionals and loops). This is pretty much the same for every programming language, and here, the specifics of Python are covered.

To get readable, reliable, and maintainable code, code organisation does matter quite a bit. Things to cover are namespaces and scope of symbols (variables, functions, classes), organising your code in files, and data structures.

The last section is an introduction into object-oriented programming (OOP), as Python is a fully object-oriented programming language and OOP actually provides some very powerful abstractions for organising code and programs.