Exercises, examples and other material relating to training module Y106. This topic is presented on public courses
Learning to program in Python,
Python Programming
Python Programming - The fundamentals in depth, and an introduction to applications such as GUI design and Data Munging.
This course starts at the fundamentals ... http://www.wellho.net/course/ypfull.html [course] |
Learning to Program in Python - The fundamentals in depth, and an introduction to applications such as GUI design and Data Munging.
This course starts ... http://www.wellho.net/course/ylfull.html [course] |
What's the difference between a function and a method? A function is a named piece of code that performs an operation, and a method is a function with ... http://www.wellho.net/mouth/900_Pyth ... ethod.html [short article] |
I call my father Dad but everyone else calls him Norman . Same person, different name.
If Dad puts on the hat that he s got from the Christmas cracker ... http://www.wellho.net/solutions/python-c ... rence.html [longer article] |
We have two friends. They're married. She's a keen advocate of Object Oriented Programming and he can't stand the approach. So take them to the pub, ... http://www.wellho.net/mouth/2169_Whe ... ques-.html [short article] |
"Object Oriented Programming" is a whole new philosophy for programmers who have been writing short scripts for years, and it can be quite frightening ... http://www.wellho.net/mouth/1925_Int ... mming.html [short article] |
In Object Oriented programming, you'll have certain named blocks of code (usually known as methods) that you can perform on specific objects (type A), ... http://www.wellho.net/mouth/477_Clas ... ables.html [short article] |
Python is an object oriented language. You can group code that relates to a particular type of data together into a class, with each piece of code that's defined being a method that can run on the class as a whole, or on a specific set of data (object).
This topic is presented on public courses
Learning to program in Python,
Python Programming
Examples from our training material
| animal.py | Sample class (exercise) - animal |
| c1 | Defining and using a class - early steps |
| containers.py | Shapes used for items in junkroom |
| creatures | Exercise answer - program to test class animal |
| cubbyhole | Simple class - with a class variable |
| drink.py | definition and testing of a class |
| glue | Shows danger of using direct access to a member variable |
| longer | Saving a lambda in a variable and other tricks |
| pets | OO sample - definition and use of two dog objects |
| pyobs | test program for containers in junkroom |
| rr2 | Object equality, identity and sameness |
| wr2.py | Test application for "writer" class |
| wr_test.py | Test harness for writer class |
| writer.py | A simple class - constructor, object method and class method, no inheritance |
Pictures
Classes in Python
Background information
This module is available under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
What is Object Orientation and why use it?.
Using Python objects.
Creating your own classes in Python.
Method and variable naming standards.
Including a test harness in your class definition.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.