PacktPublishing/Python-Programming-Blueprints

TypeError: object() takes no parameters

Closed this issue · 2 comments

having this result

Traceback (most recent call last):
File "/home/b4ec8699db306d71b68ee45f60756296.py", line 10, in
a = CSStudent(123)
TypeError: object() takes no parameters

for giving following code

class CSStudent:

stream = 'cse'

def init(self, roll):

    self.roll = roll

a = CSStudent(123)
b = CSStudent(456)
c = CSStudent(789)

print(a.stream)
print(b.stream)
print(c.stream)

print(a.roll)
print(b.roll)
print(c.roll)

Hey @kazis12 ,
Can you please provide me the chapter number and its file name? It would be more helpful If you could provide a direct link to the code file where you are facing an error.

Do get in touch in case of any concerns.

Greetings!

Please reopen the issue if the issue still persists.