Python, convert an integer into an index?

Tim Daneliuk tundra at bogus-city.tundraware.com
Wed Sep 23 11:55:17 EDT 2015


On 09/22/2015 04:43 PM, 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
> 



results = [x for x in str(results)]



More information about the Python-list mailing list