diff --git a/nDigitNumberCombinations.py b/nDigitNumberCombinations.py new file mode 100644 index 00000000000..302452c7f52 --- /dev/null +++ b/nDigitNumberCombinations.py @@ -0,0 +1,12 @@ +# ALL the combinations of n digit combo +def nDigitCombinations(): + try: + npow = 10**n + numbers=[] + for code in range(npow): + code=str(code).zfill(n) + numbers.append(code) + except: + # handle all other exceptions + pass + return(numbers)