I am new to python (coming from the c++ world) and was experimenting with class methods. I created a method without any argument (purposefully avoided self argument in this case). Then I tried to call it
class car:
def car_method():
print("Inside Car method")
obj = car_method()
obj.car_method() <---- this creates error: TypeError: car_method() takes 0 positional arguments but 1 was given
Run Code Online (Sandbox Code Playgroud)
I think this error is because, In Python, every class method, when called is always passed at least one …