Alex Rivera | Logout

Unpack to unknown number of variables?

Asked 2009-01-10T23:15:59.037
19

How could I unpack a tuple of unknown to, say, a list?

I have a number of columns of data and they get split up into a tuple by some function. I want to unpack this tuple to variables but I do not know how many columns I will have. Is there any way to dynamically unpack it to as many variables as I need?

Edit
Report

1 Answer

10

Unpack the tuple to a list?

l = list(t)
answered 2009-01-10T23:18:02.917

Your Answer