I'm trying to create a function that returns all the circular numbers from a given number, and it's giving me an odd result. The function is:
def getcircs(mylist):
circs=[]
x=mylist
y=list(x)
dig=len(x)-1
j=0
circs.append(x)
while j < dig:
for i in range(0,dig):
r=i+1
g=x[r]
y[i]=g
y[dig]=x[0]
print y
circs.append(y)
x=list(y)
j+=1
print circs
return circs
And as you can see when you run it, the lists 'y' are returning what I'm looking for, but the list 'circs' doesn't seem to have the right 'y' value appending to it. I'm wondering if it's an issue with the way Python references lists, but I can't figure it out. Thanks.
ylist tocircsmultiple times.