How to Iterate through a list of tuples in Python

1 Answer

0 votes
lst_tpl = [(1, 2, 3), (4, 5, 6, 7), (8, 9)] 
 
for tpl in lst_tpl:
    for item in tpl:
        print(item)
 

  
  
  
'''
run:
  
1
2
3
4
5
6
7
8
9
  
'''

 



answered Jul 25, 2022 by avibootz

Related questions

1 answer 112 views
112 views asked Jun 18, 2022 by avibootz
1 answer 138 views
1 answer 78 views
78 views asked Dec 25, 2024 by avibootz
1 answer 172 views
1 answer 151 views
2 answers 224 views
2 answers 158 views
158 views asked May 9, 2021 by avibootz
...