B
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 = 100000)
print(bob.name, bob.pay)
print(sue.name, sue.pay)
I am getting the following error message:
Traceback (most recent call last):
File "C:/Python31/person1.py", line 7, in <module>
bob = Person('Bob Smith')
TypeError: object.__new__() takes no parameters
All suggestions gratefully received.
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 = 100000)
print(bob.name, bob.pay)
print(sue.name, sue.pay)
I am getting the following error message:
Traceback (most recent call last):
File "C:/Python31/person1.py", line 7, in <module>
bob = Person('Bob Smith')
TypeError: object.__new__() takes no parameters
All suggestions gratefully received.