Introduction to Python - with application to bioinformatics

This course provides a practical introduction to the writing of  Python  programs for the complete novice. Participants are lead through the core aspects of Python illustrated by a series of example programs. Upon completion of the course, attentive participants will be able to write simple Python programs from scratch and to customize more complex code to fit their needs.

  • The course is suitable for complete beginners and assumes no prior programming experience (beyond the ability to use a text editor).
  • A very basic knowledge of UNIX would be an advantage, such as navigating through folders and issuing commands at a shell prompt. We will not teach Unix in detail: Other course are available at SciLifeLab for it.

Before the first lecture, we require you to follow the steps detailed in the pre-course material.


10 - 14 October 2022
SciLifeLab Uppsala, Entrance C11, BMC, Husargatan 3, Uppsala OR Umeå Universy, KBC building, room KBG201

Audience Course open to PhD students, postdocs, and other researchers. Note that priority is given to Swedish academia.

Fee A course fee of 2000 SEK will be invoiced to accepted participants. This includes lunches, coffee and snacks, and course dinner. Please note that NBIS cannot invoice individuals


By participating you will be agreeing to the NBIS Code of Conduct.


 Covered topics

During this course, you will learn about:

  • Core concepts about Python syntax: Data types, blocks and indentation, variable scoping, iteration, functions, methods and arguments
  • Different ways to control program flow using loops and conditional tests
  • Regular expressions and pattern matching
  • Writing functions and best-practice ways of making them usable
  • Reading from and writing to files
  • Code packaging and Python libraries
  • How to work with biological data using external libraries (if time allows).


 Learning outcomes

At the end of the course, students should be able to:

  • Use variables and exlain how operators work
  • Process data using loops
  • Separate data using if/else statements
  • Use functions to read and write to files
  • Describe their own approach to a coding task
  • Understand the difference between functions and methods
  • Be able to read the documentation for built-in functions/methods
  • Give examples of use cases for dictionaries
  • Write data to a simple dictionary
  • Understand the concept and syntax of a function
  • Write basic functions for processing data
  • Describe pandas dataframes
  • Give examples of how to use pandas for processing data
  • Explain how regex can be used
  • Define the python syntax for regex
  • Combine basic concepts to create functional stand-alone programs to process data
  • Write file processing Python programs that produce output to the terminal and/or external files
  • Explain how to debug and further develop your skills in Python after the course


Learning objectives (ie goals for the teachers)

  • Increase the student’s toolbelt for better quality and performance at work
  • Make students understand that there is more to programming than only knowing  the syntax of a language. 


format.png   Format

This course runs in parallel both on-site in Uppsala and in Umeå. Lectures will be streamed online from our Uppsala site to the Umeå site. Several teaching assistants will be present both in the Umeå and Uppsala classroom all week to help with exercises and questions. When registering you will be asked to which site you apply.

The course will consist of:

  • Presentations and demonstrations, given as short lectures.
  • Practical exercises, where teaching assistants will be at hand helping you.
  • A longer Project, which you work on throughout the week.

We do not require you to buy a companion book, as there are already lots of resources online. However, if you insist, we can suggest  Programming Python,  Learning Python, or  Programming in Python 3. Such books can prove useful for your programming tasks, even after the course is over.



This is a national course. The course is open for PhD students, postdocs, group leaders and core facility staff. We do accept application from other countries, but give priority to applicants from Swedish universities prior to applicants from industry and academics from other countries.

Please note that NBIS training events do not provide any formal university credits. The training content is estimated to correspond to 1.5 hp credits, however the estimated credits are just recommendations. If formal credits are crucial, the student needs to confer with the home department before submitting a course application in order to establish whether the course is valid for formal credits or not.

Entry requirements

No previous experience with programming is required. However, it is advantageous with a very basic knowledge of UNIX, such as navigating through folders and issuing commands at a shell prompt.

Due to teacher resources, the course can accommodate maximum of 25 participants in Uppsala and 15 in Umeå. If we receive more applications, participants will be selected based on several criteria. Selection criteria include correct entry requirements, motivation to attend the course as well as gender and geographical balance.


 Schedule (preliminary)



 Precourse material

Please read carefully the Pre-course material before the course start.



  Course staff

Nina Norgren - course leader

Dimitris Bampalikis - course leader

Nanjiang Shu - course leader

Jeanette Tångrot - course leader


CC attribution share alike This course content is offered under a CC attribution share alike license. Content in this course can be considered under this license unless otherwise noted.