How to convert list to string

0 votes
How can I convert a list to String in Python?
Feb 8 in Python by Nandini
• 5,480 points
20 views

1 answer to this question.

0 votes

To convert list to string in Python can be illustrated with the help of an example:

numbers = [12,13,14]
string = ' '.join(str(num) for num in numbers)
string


Output

'12 13 14'
type(string)

Output

str

This is how a list can be converted into string.

answered Feb 9 by Dev
• 6,000 points

Related Questions In Python

+1 vote
2 answers

How to convert list to string

mylist = [1, 2, 3] ‘’.join(map(str, mylist)) ==> ...READ MORE

answered Aug 21, 2018 in Python by Omkar
• 69,210 points
280 views
0 votes
1 answer

How to convert each list item into string in a column of data frame. ?

Hey, To split a string you can use ...READ MORE

answered Feb 5, 2020 in Python by Roshni
• 10,500 points
361 views
0 votes
1 answer

Python - convert string to list

try states.split() this would help. READ MORE

answered Jul 20, 2018 in Python by Priyaj
• 58,080 points
362 views
0 votes
1 answer

Python - convert string to list

states.split() will return ['Alaska', 'Alabama', 'Arkansas', 'American', 'Samoa', ...READ MORE

answered Jul 25, 2018 in Python by Frankie
• 9,830 points
230 views
0 votes
1 answer

Python join: why is it string.join(list) instead of list.join(string)?

This is because join is a "string" ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 58,080 points
361 views
0 votes
1 answer

What exactly does the .join() method do?

Look carefully at your output: 5wlfgALGbXOahekxSs9wlfgALGbXOahekxSs5 ^                 ^                 ^ I've ...READ MORE

answered Oct 10, 2018 in Python by SDeb
• 13,300 points
179 views
0 votes
2 answers
0 votes
1 answer

How to reverse a list?

A  list in Python can be reversed ...READ MORE

answered Feb 11 in Python by Dev
• 6,000 points
21 views
0 votes
1 answer

Converting integer to string in Python

In order to convert an object to string ...READ MORE

answered Feb 11 in Python by Dev
• 6,000 points
24 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP