Skip to content

How do i convert a list to a string in Python?

lines2 = " ".join(lines) 	# Converts the list to a string.
							# This should work for writing to a file
file.write(lines2)
See also  How to reverse string in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.