3 Day – Python Programming

A 3 day introduction to Python Programming that covers core language features such as namespaces, data types, flow control, functions, objects, exception handling, file I/O and modules. The focus is on using best practices and techniques to develop professional quality programs and scripts.

Prerequisites

This course is designed for staff who have practical programming experience with at least one programming or scripting language: no prior knowledge of Python or OO programming is assumed.

Learning Objectives

The course will help developers understand the basic principles of writing Python programs, specifically:

  • Understanding Python syntax
  • Built in data types and objects
  • Flow control statements
  • Using and defining functions
  • Error handling and recovery
  • Reading and writing files
  • Simple numeric data analysis
  • Introduction to classes and structured data
  • Code Quality

Delivery

This course comprises a mix of theory, demonstrations and hands on exercises. Approximately 50% of the time is hands-on.

Day 1 – Core Language

  • Python variables and namespaces
  • Data object model
  • Console I/O
  • Conditional IF statements
  • String and numeric data
  • The WHILE loop
  • Functions, Arguments and return values
  • Positional and keyword arguments
  • Importing modules and packages

Day 2 – Collections

  • Sequence concepts
  • Lists & Tuples
  • Subscripts, slices and strides
  • The FOR loop
  • BREAK and CONTINUE statements
  • List comprehension
  • Dictionaries
  • Numeric arrays
  • TRY-EXCEPT exception handling
  • Raising exceptions
  • Writing error messages
  • Exit status codes
  • Using the WITH statement

Day 3 – Writing Applications

  • Reading and writing files
  • Handling csv and numeric data
  • Text processing techniques
  • Command line arguments
  • Working with the file system
  • Structured data types
  • Defining classes
  • Object attributes and methods
  • Code quality and Unit testing
  • Modules, packages and PYTHONPATH