I want to create possible list of numbers from given list. For ex.
a = [5, 9]
should result in 59, 95.
How do I do it in python. Please note contents of list a could be variable.
Thanks in advance
This might be helpful.
import itertools
a = [5,9]
a = "".join(str(i) for i in a)
x = list(itertools.permutations(a))
x = ["".join(tupl) for tupl in x]
print(x)
['59', '95']
a = [5, 5]? What ifa = [1, 2, 3]? What ifa = [10, 11, 12]?