Search code snippets, questions, articles...

String characters to list items using python

You can convert string to list and all its characters to list items using python.
my_str = "Devsheet"

my_list = list(my_str)
print(my_list)

#-> ['D', 'e', 'v', 's', 'h', 'e', 'e', 't']
Output
['D', 'e', 'v', 's', 'h', 'e', 'e', 't']

Search Index Data (The code snippet can also be found with below search text)

string to list python
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet