def tuplify(number):
x = str(number)
if len(x) <= 0:
return 0
lst = []
for i in range(0,10):
if i == x[len(x)-1]:
lst.append(i)
return tuple(lst)
This is my code and I can't get the output I want.
tuplify(102486)
which should give me (1, 0, 2, 4, 8, 6)