Learn to program using Python
This is a gentle introduction to the Python programming language. It assumes no prior programming experience and it aims to help you become fluent in the fundamentals. You will design, implement, test and debug real procedural programs, and will be able to read and reason about simple Python programs.
Learning outcomes
By the end you will be able to:
- Write simple procedural programs.
- Read and analyze the behavior of simple programs.
- Apply decomposition — break a program into functions and modules.
- Choose appropriate data structures, conditionals, and iteration for a task.
- Use primitive types, variables, strings, expressions, and command-line I/O.
- Use conditional and iterative control structures, functions, and parameter passing.
- Use each of tuples, lists, sets, and dictionaries.
- Use the standard library.
- Use file I/O for persistence across runs.
- Test and debug simple programs.
A note on tools
You need almost nothing: a recent Python and any editor. We use the REPL (the
interactive >>> prompt) constantly for quick checks, and script files for anything
multi-line. The built-in help(), the official Python tutorial, and the interpreter's
own error messages are the only references you will need.