I have the following tuple (list_permutation):
[(1,), (2,), (3,), (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2)]
And I want to convert it in a list that looks like:
[[1],[2],[3],[1,2],[1,3]]...
This is my code that I've already tried:
result = [int(x) for x, in list_permutation]
print(result)
But I'm getting this error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-63-fc7f88d67875> in <module>
----> 1 result = [int(x) for x, in list_permutation]
2 print(result)
<ipython-input-63-fc7f88d67875> in <listcomp>(.0)
----> 1 result = [int(x) for x, in list_permutation]
2 print(result)
ValueError: too many values to unpack (expected 1)