Skip to content

Instantly share code, notes, and snippets.

@ixxra
Created August 29, 2014 19:13
Show Gist options
  • Select an option

  • Save ixxra/cada3ea609c89f0a4515 to your computer and use it in GitHub Desktop.

Select an option

Save ixxra/cada3ea609c89f0a4515 to your computer and use it in GitHub Desktop.
This is a example of how to split a list of numbers into a list of digits.
#this program converts a list of integers into a list of digits
l = range(400, 450)
numeros_separados = []
for v in l:
digitos = []
y = v
for k in range(4, -1, -1):
digitos.append(y/10**k)
y = y % 10**k
numeros_separados.append(digitos)
print numeros_separados
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment