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 172 views
3 answers 278 views
1 answer 156 views
2 answers 264 views
2 answers 230 views
...