+ 1
Whenever i am defining a class and creating an instance of it ,, a TypeError is generated . why so ?
3 Réponses
+ 2
Try to change the name of your class, because python already define a type "complex" as the int, long, float, ...
+ 1
Please provide sample of the code you used to create class and instance of it.
0
class complex:
def __init__(self,real,imag):
self.r=real
self.i=imag
x=complex(3,-4.5)
TypeError : this constructor takes no arguments