splitting and concatenating a string

0 votes
I wanted to know if python had a built in function similar to:

string->list
 

and

list->string in scheme.

So What should I do if I want to turn 'abc' into ['a','b','c'] and vice versa using a built in function?
Apr 17 in Python by ana1504.k
• 6,110 points
32 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
You can try the following code in order to convert from String to list:

>>> list('abc')
['a', 'b', 'c']
 

And for List to string:

>>> ''.join(['a', 'b', 'c'])
'abc'
answered Apr 17 by SDeb
• 9,660 points

Related Questions In Python

0 votes
2 answers

Splitting a Python String

The split() method in Python returns a ...READ MORE

answered Oct 3, 2018 in Python by anonymous
44 views
+4 votes
6 answers

Splitting a List into chunks in Python

Here's a generator that yields the chunks ...READ MORE

answered Apr 13, 2018 in Python by Nietzsche's daemon
• 4,260 points
1,826 views
0 votes
2 answers

What do you mean by python scripting? What is a script and a module in python?

A scripting language is a programming language ...READ MORE

answered Mar 14 in Python by rajesh kumar
1,714 views
0 votes
1 answer

Padding a string

>>> s = '1123' >>> print s.zfill(8) #desired ...READ MORE

answered May 4, 2018 in Python by Nietzsche's daemon
• 4,260 points
23 views
0 votes
1 answer

How do I append one string to another in Python?

If you only have one reference to ...READ MORE

answered Oct 22, 2018 in Python by SDeb
• 9,660 points
21 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
24 views
0 votes
1 answer

Is there a string 'contains' in python?

In this case, you can use the ...READ MORE

answered Sep 25, 2018 in Python by SDeb
• 9,660 points
45 views
0 votes
1 answer

How to convert a Unicode string to string

It can be done in the following ...READ MORE

answered Oct 16, 2018 in Python by SDeb
• 9,660 points
50 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.