I just learn python today, and so am thinking about writing a code about recursion, naively. So how can we achieve the following in python?
class mine: def
Each method of a class has to have self as a first parameter, i.e. do this:
self
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, ....)