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
  • 67
  • 6

1 Answers1

1
print(list(s))

Output:

['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
1pluszara
  • 1,518
  • 3
  • 14
  • 26
  • 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