An error appears that the python class object does not have a parameter.

Asked 2 years ago, Updated 2 years ago, 102 views

Call on the edit page.Create a py file I put a simple class function in the file

Next, I imported it from the console window, but the error message object() takes no parameters appears.

If you write m = Call ("John"), doesn't the John variable become an object parameter?

class parameter python3

2022-09-22 20:32

1 Answers

The initialization function appears to be a typo. Try changing it as below.

#def __init(self, name):

def __init__(self, name):


2022-09-22 20:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.