How to convert a tuple of strings to integers in Python

1 Answer

0 votes
tpl = ('5', '9', '3', '1', '89', '250')

tuple_of_integers = tuple(int(item) for item in tpl)

print(tuple_of_integers) 
 
   
   
   
'''
run:
   
(5, 9, 3, 1, 89, 250)
 
'''

 



answered Jul 24, 2022 by avibootz
...