How to merge two tuples in Python?

前端 未结 4 677
日久生厌
日久生厌 2020-12-29 19:53

How to convert the following tuple:

from:

((\'aa\', \'bb\', \'cc\'), \'dd\')

to:

(\'aa\', \'bb\', \'cc\', \'dd\')
         


        
4条回答
  •  清酒与你
    2020-12-29 20:37

    l = (('aa', 'bb', 'cc'), 'dd')
    l = l[0] + (l[1],)
    

    This will work for your situation, however John La Rooy's solution is better for general cases.

提交回复
热议问题