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=

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

Re: basic Class in Python

2010-01-17 Thread BarryJOgorman
On Jan 17, 11:09 pm, John Bokma wrote: > BarryJOgorman writes: > > class Person: > >     def _init_(self, name, job=None, pay=0): > >       def __init__(self, name, job=None, pay=0): > > Note 2x _ before and afte

basic Class in Python

2010-01-17 Thread BarryJOgorman
Working through Lutz's 'Learning Python' Trying to run the following code (from file person.py - see below): The file is held in Python31. at the Python31 prompt am entering ''person.py' Getting the following error: Traceback (most recent call last) File "C:python31\person.py", line 9, in (modu