I am trying to call the __init__ variable as a default variable but it is not calling
class test1:
def __init__(self,name):
self.name = name
def method1(self,name2=self.name):
return name2
If I call the function like
from test import test1
ma = test1("mkHun")
va = ma.method1() # Here I am expected output is mkhun
ca = ma.method1("new name")
In JavaScript this features is called as default parameters. Is this features is available in python or something problem with my code?