I am trying to remove a digit from an integer.
My code seems to work except when I input an integer such as 8880888.
For some reason, with an integer above, when removing the index passing the middle number, but it doesn't remove the correct index.
n = 8880888
def question(n):
newlist = [int(x) for x in str(n)] #coverting integer to list
result = newlist[:]
y = newlist[5]
result.remove(y)
return result
When removing the 5th element, it should return 888088. But instead, I am being returned 880888.