Hello I am new to python...I met with this simple problem
def search(path,filename,extension):
name=' '
listdir=os.listdir(path)
print listdir
flname=filename+'.'+extension
i=0
match=''
while(i<len(listdir)):
if(listdir[i]==flname):
match='YES'
print 'got the match'
break
i=i+1
if(match=='YES'):
assign(filename)
else:
name = filename+'.'+extension
print 'the filename is',name
return name
lets_text=search(path,filename,extension)
print 'the name we gt is',lets_text
The above problem has to return me a valid string. but instead of that it return None...I dont know why?...I am getting correct value for variable "name"....but when it returns it come up with None