Python for Programmers

This lesson will teach you some of the basics of the Python programming language. It assumes that you have some experience programming in another interpreted language. In particular, it is meant to help users of Matlab recognize the similarities and differences between these two languages.

It is based on materials written by Justin Kitzes as part of his Data Science Lectures, with input from Matt Davis and Greg Wilson.

The materials are based on a tour through the 7 elements that every programming system must have:

  1. Individual things (the number 2, the string ‘hello’, a figure)
  2. Commands that operate on things (the + symbol, the len function)
  3. Groups of things (lists, arrays, tuples, dictionaries)
  4. Ways to repeat yourself (for and while loops)
  5. Ways to make choices (if and try statements)
  6. Ways to create chunks (functions, objects/classes, modules)
  7. Ways to combine chunks (function composition)

This lesson template is based on the lesson template used in Data Carpentry and Software Carpentry workshops,


13:05 Firing up Python Is this thing on?
13:20 Individual things What are some things in Python?
13:35 Collections: groups of things What are collections of things?
13:50 Repeating operations How can we repeat operations?
14:05 Go get some coffee! Break
14:15 Making choices How can we select operations to execute, depending on the situation?
14:30 Creating reusable chunks with functions How can we avoid repeating ourselves?
14:45 Plotting with Matplotlib How can we visualize data?
14:55 Finish