Skip to content
Advertisement

How to generate unto n digit combinations of an integer? [closed]

I’m trying to create a program in python which generates all the possible combinations (non-repeating) for a given number

If the input is “123”, Output should be

JavaScript

My current code is

JavaScript

Advertisement

Answer

You can use itertools.permutations:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement