- 1
error in defining class
It says TypeError: object takes no parameters
3 ответов
+ 1
Provide the code?
+ 1
There is a number of issues with the example you provided, numbers below are by line:
1) class is case-sensitive, so you must use the lower case
2) Defining a function is case sensitive as well, you must use a lowercase 'd', not capital. Also you must use two underscores on each side of init (This is why you get the Object takes no paramaters error, specifically).
3-4) same issue, self is lowercase
Here's an example code:
https://code.sololearn.com/cEnYh5M2l49y
0
It’s actually one I used to try
Class mydogs:
Def _init_(self,color,name):
Self.color=color
Self.name=name
Dog1=mydogs(“brown”,”tom”)
Then comes the error...