When I create an object myr = Rectangle(10,5). It returns the following error Traceback (most recent call last): File "", line 1, in myr = Rectangle(10,5) TypeError: object() takes no parameters
it means there are no parameters in constructor so do it like this def__init__(self,width=0,height=0): it will work i was also having the same error but by doing it like this it solved the problem
can't believe this is 13 years ago, you're legend
Thanks David for a very clear and well presented video tutorial on python classes.Tim
where are new videos?
Watching in 2021 :')
@OJIT PANDITA Same here :(
Same question! :(
@@parthasarathibarman9862 same question! :( maybe he lost his youtube account
please show accessor and mutator method for emplyee class
When I create an object myr = Rectangle(10,5). It returns the following error
Traceback (most recent call last):
File "", line 1, in
myr = Rectangle(10,5)
TypeError: object() takes no parameters
it means there are no parameters in constructor
so do it like this
def__init__(self,width=0,height=0):
it will work i was also having the same error but by doing it like this it solved the problem
@@chirayu8210 I was still a noob. Now I am laughing at my comment six years later, lol
Well rip
Watching 2024 : )
how bout java..?