0

I have the following tuple

res = [('fdetail',), ('fdetail1',)]

I want to have it in two variables using Python

var1 = fdetail

var2 = fdetail1

Any help is highly appreciated.

1 Answer 1

8

Because you've got a list of one-tuples, you'll need to do a nested unpack:

(var1,), (var2,) = res
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.