We generally declare functions as instance methods as such:
Here x is the parameter. To call the function, for example, we supply 10 as the argument here:
Class methods are shared among all instances and they are called with the calling class as the first argument.
Static methods are called without any class or instance reference.
Function parameters can have default values as shown. In the below example,
next_node are optional arguments to be provided by the calling program.