how to converting a list to a string?

By Jennifer, 6 months ago
  • Bookmark
0

convert following list into string

list1 = ["India", "is","my","country"]

List
String
1 Answer
0

You can simply use join() for this in the print function

list1 = ["India", "is","my","country"]
str1 =" ".join(list1)

print(str1)    #output   India is my country

type(str1)    #output  str

Your Answer

Webinars

How Machine Learns in Machine Learning?

Oct 28th (7:00 PM) 188 Registered
More webinars

Related Discussions

Running random forest algorithm with one variable

View More
We're Online!

Chat now for any query