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 315 views
1 answer 312 views
2 answers 343 views
343 views asked May 10, 2018 by avibootz
2 answers 278 views
1 answer 250 views
1 answer 335 views
...