Python: Introduction for Absolute Beginners
Course description
This course is part of the Scientific Computing series, and as such the examples chosen are of most relevance to scientific programming.
This course is aimed at those new to programming and provides an introduction to programming using Python, focussing on scientific programming. This course is probably unsuitable for those with significant programming experience (such individuals should try the “Python: Introduction for Programmers” course instead). By the end of this course, attendees should be able to write simple Python programs and to understand more complex Python programs written by others.
The course notes (in various forms) are available here.
The files used during the course are available here.
Afternoon one:
- Launching Python
- Values and Types
- Integers
- Floating point numbers
- Strings
- Variables
- Tests
- if...else...
- while...
- Comment lines
- Unix executable Python scripts
Afternoon two:
- Lists
- for...in...
- Manipulating lists
- Functions that give lists
- Dictionaries
- Treating dictionaries as lists
- Manipulating dictionaries
- Functions
Afternoon three:
- Reusing functions
- Modules
- Tuples
- String substitution
- String formatting
- Accessing files
- Treating files as lists
- Standard input and output
- Command line arguments
- Converting between types
- Creating programs out of functions
- Testing functions
- Documentation (doc strings)
Notes
The course notes for the “Python: Introduction for Absolute Beginners” course are available in various formats.
| Day one | Foils (PDF) | Notes (PDF) | Source (ODP) |
| Day two | Foils (PDF) | Notes (PDF) | Source (ODP) |
| Day three | Foils (PDF) | Notes (PDF) | Source (ODP) |
The course features two extra handouts with a list of useful Python modules and a summary of the Python formatting codes. These are available as source (ODT) or as PDF. The home directory set up for the course attendees is available for browsing or as a TGZ download.
| Modules | ODT | |
| Formatting | ODT | |
| Home directory | TGZ | browse |
All comments or questions regarding this course, and the course materials provided on this page, should be sent to escience-support@ucs.cam.ac.uk.
The title of this document is:
Python: Intoduction for Absolute Beginners
URL:
http://www-uxsup.csx.cam.ac.uk/courses/PythonAB/index.html

