-2

I am new to using python. I have a list of integers that I want to convert into an actual list. This is the result that I'm getting

>>>si(2358) 
(((2, 3), 5), 8)... 

I want to be able to sort the result in ascending order so I think I'm going to have this in an actual list:

[2,3,5,8]

How can I go about doing this? Code:

>>> def si(n):    
...     if (n)<10:
...         return n
...     else:
...         return si(lastdig(n, 10)), allbutlast(n)
Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119

1 Answers1

0

Something like this will work:

n = 2358
l = [int(c) for c in str(n)]
Paul Evans
  • 27,315
  • 3
  • 37
  • 54