Introduction#

This textbook is written for Computation for Biologists (NWI-BM066A).

In addition to the textbook, some suggested resources are listed here, in no particular order:

Before you start#

Python comes in two major versions, Python 2 and 3. This course will use Python 3. Python 2 is no longer supported, however you might still find many Python 2 materials and examples on-line; therefore please be aware.

This course will be running on Google Colab, a free Jupyter Notebook environment that runs on Google’s cloud servers. You will need to sign in with a Google account - your personal Google account is perfectly fine for this. Additional files that you will need for the exercises are shared with you using Google Drive. See “Google Colab and Google Drive” on Brightspace for a step-by-step guide to set these up.

To run Python on your local computer (optional)#

If you want to run Python on your local computer, we recommend to install the Anaconda distribution: https://www.anaconda.com/download/. This installer works on Windows, Mac and Linux and contains all the necessary packages. Jupyter Notebook is part of this distribution, which allows you to run a notebook server locally.

To edit Python code on your local computer you have to use a text editor. Don’t use Word or Notepad! Suggested editors that are freely available include Notepad++ for Windows, TextWrangler for Mac OSX and gedit for Linux. Alternatively, Visual Studio Code is a powerful and free code editor that is available on all platforms.

Additional remarks#

Note that Python is very particular about spaces: you need to indent the inner body of funtions, for loops and if-statements.

Don’t be afraid to experiment. Learning by trial and error usually works well for learning to program. Carefully read the error messages if something does not work.

When writing code you have to be very precise. Every character matters. If your code doesn’t work, check for typos first!

Style guide for this course#

  1. Use descriptive variable and function names.

  2. Variable and function names should be in the style of lower_case_with_underscores.

  3. Be consistent with the number of spaces in indentations.

  4. Use return in functions.

  5. Have doc strings in functions.