def choice(n,s=[]):
a=s
if n==0:
string=''
d=[str(a[len(a)-i-1]) for i in range(len(a))]
string=string.join(d)
print(string)
return string
if (n-1)%2==0:
a.append(1)
n=float(n-1)/2
return choice(n,a)
if (n-2)%2==0:
a.append(2)
n=float(n-2)/2
return choice(n,a)
choice(10)#this print 122 ,it's right
choice(10)#but when I run it again ,this print 122122
I dont know what to do
please help me!!!