g=0
def smooth(self, a, b):
k=0
c = self.name[a]
d = self.name[b]
e,f=c,d
while(e.get_p()!=f.get_p() and e.get_p()!=None and f.get_p()!=None):
k+=1
e=e.get_p()
f=f.get_p()
if(e.get_p==None and f.get_p()!=None):
global g
g+=1
d=d.get_p()
return self.smooth(a,d.name)
return(k,g)
Ignore the functions called but in the if statement it is not updating value of g and giving an error global name 'g' is not defined on calling with a value.Please Help
class?