Tuesday, 2 August 2022

python list to string

 https://stackoverflow.com/questions/5618878/how-to-convert-list-to-string


>>> xs = [1, 2, 3]       
>>> " ".join(str(x) for x in xs)
'1 2 3'

No comments:

Post a Comment