[Tutor] Writing Classes in python

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Nov 1 22:36:33 CET 2006

On Wed, 1 Nov 2006, Rajesh R wrote:

> I am new to Python and i have a very basic question about writing 
> classes. Lets say i have the following code :
[code cut]

Hi Rajesh,

Take a look at a Python class tutorial:


The syntax you're writing is almost right, but there are some specifics 
that you're missing.  In Python, methods need to take an explicit 'self' 

Good luck!

More information about the Tutor mailing list