Re: Starting with Classes - basic problem

2010-02-22 Thread barryjogorman
On Feb 22, 5:33 pm, Bernard Czenkusz wrote: > On Mon, 22 Feb 2010 09:26:18 -0800, barryjogorman wrote: > >HAVE THE FOLLOWING VERY BASIC PROGRAM: > > >class Person: > >    def _init_(self,name, job=None, pay=0): > >        self.name=name > >        self.job=job > >        self.pay=pay > > >bob = Pe

Re: Starting with Classes - basic problem

2010-02-22 Thread MRAB
barryjogorman wrote: HAVE THE FOLLOWING VERY BASIC PROGRAM: class Person: def _init_(self,name, job=None, pay=0): self.name=name self.job=job self.pay=pay bob = Person('Bob Smith') sue = Person('Sue Jones', job='dev', pay = 10) print(bob.name, bob.pay) print(sue.

Re: Starting with Classes - basic problem

2010-02-22 Thread alex goretoy
you need to define init with two underscores, I've made that mistake myself long long time ago :) def __init__ not def _init_ -Alex Goretoy -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting with Classes - basic problem

2010-02-22 Thread Bernard Czenkusz
On Mon, 22 Feb 2010 09:26:18 -0800, barryjogorman wrote: > HAVE THE FOLLOWING VERY BASIC PROGRAM: > > class Person: > def _init_(self,name, job=None, pay=0): > self.name=name > self.job=job > self.pay=pay > > bob = Person('Bob Smith') > sue = Person('Sue Jones', job='

Starting with Classes - basic problem

2010-02-22 Thread barryjogorman
HAVE THE FOLLOWING VERY BASIC PROGRAM: class Person: def _init_(self,name, job=None, pay=0): self.name=name self.job=job self.pay=pay bob = Person('Bob Smith') sue = Person('Sue Jones', job='dev', pay = 10) print(bob.name, bob.pay) print(sue.name, sue.pay) I am ge