0

Say I have a string like this:

'0123456789'

can I convert that into a list like this?

['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

Thanks in advance! I've been searching for a while, but haven't found precisely what I want, so I asked a question.

qrani
  • 37
  • 5

1 Answers1

1
print(list(s))

Output:

['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
U12-Forward
  • 65,118
  • 12
  • 70
  • 89
1pluszara
  • 1,458
  • 1
  • 11
  • 24
  • 2
    While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. – Nic3500 Aug 05 '18 at 01:43