I needed to make permutations of the input asked so I have this code
#!/usr/bin/python
import itertools
variable1 = raw_input("input 4-6 carac")
var1list = list(variable1)
lenlist = len(var1list)
itertools.permutations(variable1)
iterlist = list(itertools.permutations(variable1, lenlist))
print iterlist
So I end up with a list of tuplets So for 123 I get (1,2,3),(1,3,2)... The problem is then I need to append each of the tuplets a string, so I can't append a tupplet to a string. I need to convert each tuplet of the list to a string but without () or the commas.
E.g., from the list that contains the permutations of 123:
(1,2,3),(1,3,2)...
I need to get a list that contains each of the members of each tuplet together and separated from the mebers of the other tuplets of the list: I'm clarifying i only want THIS one:
[123, 132...] or ['123', '132'...]
These two ones are similar examples I found on already answered posts, just to clarify that I wanted something different to them.
A literal string of tuplets
"(1,2,3), (1,3,2)..."
Like in this post
or a list with all the tuplets formatted into one single list together
[1,2,3,1,3,2...]
Like in this other post
Any tip for this? I kinda control Python but I've got about none knowledge of how tuplets work.
EDIT: I think the list should be of strings (instead of integers)