How to flatten a tuple of lists in Python

1 Answer

0 votes
tpllst = ([6, 8], [1, 0, 5])

tpl = tuple(sum(tpllst, []))

print(tpl)



'''
run:

(6, 8, 1, 0, 5)

'''

 



answered Dec 2, 2022 by avibootz

Related questions

1 answer 161 views
3 answers 260 views
1 answer 144 views
2 answers 243 views
2 answers 222 views
...