24.py 169 B

12345678
  1. from itertools import permutations
  2. lexorder = 1
  3. for permutation in permutations("0123456789", 10):
  4. if lexorder == 1000000:
  5. print ''.join(permutation)
  6. lexorder += 1