I'm making anagram in python
but when I call 'list'function, it doesn't work. please help.
I'm tring to change 'str' to 'list'
but it doesn't work. I really don't know why

def generate_anagram(s):
a=s[0:len(s)-1]
b=s[len(s)-1]
if len(a)==1:
return make(a,b)
else:
return make(generate_anagram(a),b)
def make(s1,s2):
list=[]
l=len(s1)
q=list(s1)
w=list(s2)
ss=""
for i in range(l):
if(len(q)>l):
q.remove(w)
q.insert(i,w)
list+=q
for i in range(len(list)):
ss+=list[i]
return ss
if __name__ == "__main__":
print(generate_anagram("anagram"))
list()with a variable namelist