Python, convert an integer into an index?

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Sep 22 19:23:56 EDT 2015


On 22/09/2015 22:43, Chris Roberts wrote:
>
> (How do I make it into an index? )
> Preferably something fairly easy to understand as I am new at this.
>
> results = 134523      #(Integer)
>
> Desired:
> results = [1, 2, 3, 4, 5, 2, 3]   #(INDEX)
>
> Somehow I see ways to convert index to list to int, but not back again.
>
> Thanks,
> crzzy1
>

Please provide the algorithm to convert 134523 into [1, 2, 3, 4, 5, 2, 
3], as I don't see how to convert a six digit integer into a list of 
seven integers.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list