Combine list items to a string

0 votes
Is there a simple way of combining list items into a string?
Jun 7, 2018 in Python by nightshade
• 880 points
650 views

1 answer to this question.

0 votes
>>> stmt = ['this','is','a','statement']
>>> ' '.join(sentence)
'this is a sentence'
answered Jun 7, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

How to concatenate items in a list to a single string?

Hello @kartik, Use join: >>> sentence = ['this','is','a','sentence'] >>> '-'.join(sentence) 'this-is-a-sentence' Hope it ...READ MORE

answered Nov 17, 2020 in Python by Niroj
• 82,840 points
614 views
0 votes
1 answer

How to split a string into a list?

You can use the function  text.split() This should be ...READ MORE

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

How to perform string operations on every element of a list of strings?

This can be done using list comprehension ...READ MORE

answered Jul 18, 2019 in Python by Arvind
• 3,050 points
1,787 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,467 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,128 views
0 votes
1 answer

Split a string into a list of characters

This is easy. Just use the list() ...READ MORE

answered Jun 19, 2018 in Python by Hamartia's Mask
• 1,580 points
703 views
0 votes
1 answer

Convert dictionary keys to a list

list.(dictionary.keys()) READ MORE

answered Jun 28, 2018 in Python by Hamartia's Mask
• 1,580 points
572 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP