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 277 views
3 answers 436 views
1 answer 255 views
2 answers 399 views
2 answers 365 views
...