Two minor questions on Class

2010-07-30 Thread joy99
Dear Group, Hope everyone is fine. I was trying some examples of Python class. I took the following example from Ubuntu forum[http://ubuntuforums.org/ showthread.php?t=578930] class Person(object): def _init_(self,name,age): self.name=name self.age=age as

Re: Two minor questions on Class

2010-07-30 Thread Shashank Singh
On Fri, Jul 30, 2010 at 10:53 PM, joy99 wrote: > class Person(object): >def _init_(self,name,age): >self.name=name >self.age=age > > constructor has double underscores (both as prefix and suffix) __init__ -- Regards Shashank Singh Senior Undergraduate, De

Re: Two minor questions on Class

2010-07-30 Thread Peter Otten
joy99 wrote: > class Person(object): > def _init_(self,name,age): > self.name=name > self.age=age > > as i wrote the code using IDLE on WinXP SP2, with Python2.6.5, I am > getting the following error: > > >>> p=Person('Subha',40) > > Traceback (most recen