COURSE

Introduction to Python

A complete introduction to the Python Programming language.

  • 3 Days
  • Beginner
  • In-person / Online
  • £ On Request

Your team will learn...

Understand imperative, object-oriented and functional programming concepts

Build confidence writing Python scripts using modern Python 3 features

Learn how to use the IDE effectively to write and maintain code

Learn how to perform useful operations such file and network I/O

Overview

This Python course provides a complete introduction to programming using the Python scripting language. Your team will learn fundamental programming concepts and problem solving. All the important features of Python 3 will be explained using practical examples and exercises. Both the functional and object-oriented paradigms of Python are covered in depth, including best practices for using them in combination.

This course will allow delegates of any experience level to begin building automation scripts of their own. The pace and content can be tailored to meet your team's specific needs.

Outline

Introduction to Python

  • The evolution of Python from Shell Scripting and Perl
  • Installing Python and running / debugging simple scripts
  • Differences between Python 3 and earlier versions
  • Using the REPL, scripts and an IDE

The Basics of Python Scripting

  • Declaring and modifying variables
  • Understanding Dynamic and 'Duck' typing
  • Reading and writing from the console
  • Working with the built in data types
  • Making choices and performing iteration
  • Identity, equality and references

Working with Functions

  • Declaring functions and passing parameters
  • Using defaults and keyword arguments
  • Writing variadic functions
  • Performing parameter expansion
  • Scope basics and the lifetime of a variable
  • Debugging with the IDE
  • Raising and catching exceptions correctly

Working With Structured Data

  • Storing individual items in sets, lists and tuples
  • Storing pairs of items in dictionaries (aka hashes)
  • Fundamental Object-Oriented concepts
  • Understanding how class declarations work in Python
  • Creating classes and adding attributes and operations
  • Using your own types with the built-in collections
  • Useful built-in functions and methods
  • Operators for unpacking values in collections

Regular Expressions in Python

  • What is a regular expression?
  • How the Regular Expression Engine operates
  • Functions in Python that accept regular expressions
  • Creating character classes and specifying multiplicities
  • Meta-characters for specifying positions in the input
  • Using parenthesis for grouping and submatches
  • Adding comments to your regular expressions

Object Orientation

  • Creating class hierarchies in Python
  • Overriding methods from base classes
  • Adding properties to your classes
  • Guidelines for overloading operators sensibly

Basic Functional Programming in Python

  • Using functions as inputs to other functions
  • Understanding scope and closures
  • Creating and working with lambda functions
  • Using lamdbas with filter, map and reduce
  • Simplifying your code using list comprehensions

Organising Code and Modules

  • Understanding PIP and Python Packages
  • Using virtualenv to scope environments
  • Using 'pipenv' for dependencies
  • Organizing your code into modules and packages
  • Picking a testing framework and applying TDD in Python

Performing Common Tasks

  • Interacting with the operating system
  • Exploring the filesystem
  • Understanding streams and various types of I/O
  • Reading and writing text, data and objects to/from files
  • Using resources via the with statement

Requirements

None.

COURSE

Introduction to Python

A complete introduction to the Python Programming language.

  • 3 Days
  • Beginner
  • In-person / Online
  • £ On Request

Deloitte logo
Atlassian logo
Bose logo
Workday logo
BMW logo
Amex logo
McAfee logo
PWC logo