How to get a list of chars from a string in Python

1 Answer

0 votes
s = "python"

lst = [ch for ch in s]

print(lst)


'''
run:

['p', 'y', 't', 'h', 'o', 'n']

'''

 



answered Sep 10, 2018 by avibootz
...