python
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']
Was this helpful?
Similar Posts
- Split a string into list of characters in Python
- Loop through string characters in Python
- Convert all string characters to lowercase in python
- Get first N characters from a string in Python
- Add two list items with their respective index in python
- Add items to list in Python
- Delete items from a list in Python