[Solved] How to convert element int in list that inside the tuple in python


The below code will pick up the first sub-list viz.

[(468000,)]

And extract its 0th element which is a tuple

(468000,)

Applying further indexing to it, the 0th element of the tuple will be extracted.

za, zb, zc = [element[0][0] for element in z]

Each element of the list will then be assigned to za, zb, zc.

This is assuming that your sub-list will contain just one tuple and that tuple will contain just one integer.

solved How to convert element int in list that inside the tuple in python