How to convert a tuple to a string in Python

1 Answer

0 votes
tpl = (5, 7.8, 10, 3.14, 178)

_str = ' '.join(map(str, tpl))

print(_str) 

 
   
   
   
'''
run:
   
5 7.8 10 3.14 178
 
'''

 



answered Jul 24, 2022 by avibootz

Related questions

1 answer 324 views
1 answer 318 views
2 answers 349 views
349 views asked May 10, 2018 by avibootz
2 answers 284 views
1 answer 255 views
1 answer 341 views
...