How to convert a list of floats to string in Python

1 Answer

0 votes
lst = [4.12, 3.14, 1.23, 2.99] 
  
s = " ".join([str(f) for f in lst]) 
  
print(s) 



'''
run:

4.12 3.14 1.23 2.99

'''

 



answered Dec 20, 2019 by avibootz

Related questions

2 answers 223 views
4 answers 263 views
2 answers 131 views
1 answer 134 views
1 answer 112 views
...