KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why does itertools.permutations() return a list of characters or digits for each permutation, instead of just returning a string? For example: >>> print([x for x in itertools.permutations('1234')]) >>> [('1', '2', '3', '4'), ('1', '2', '4', '3'), ('1', '3', '2', '4') ... ] Why doesn't it return this? >>> ['1234', '1243', '1324' ... ]
Tags (comma-separated)
Save Edits
Cancel