Python Recursion within Class
Each method of a class has to have self
as a first parameter, i.e. do this:
def recur(self, num):
and it should work now.
Basically what happens behind the scene is when you do
instance.method(arg1, arg2, arg3, ...)
Python does
Class.method(instance, arg1, arg2, arg3, ....)