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
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.
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
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='
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