Python code to pick out all possible permutations of a n-digit number using x-y numbers only?
Question: 
    __author__ = 'Mark'
    import itertools
    
    def power(num, x=1):
      result = 1;
      for x in range(x):
        result = result * num
      return result
    print power(4,7)
    
    count = 0
    for subset in itertools.product('0123456', repeat = 4):
         print(subset)
         count +=1
         print count
    

I need to enumerate all possible permutation of a 4-digit number using 0-6
only with repetition.


Answer: Take a look at product, permutations, combinations,
combinations_wit_replacement functions from
[itertools](https://docs.python.org/2/library/itertools.html).

