+ 1
Input from string to list
Is there a way in python to ask for an input and turn it into a list. For example: ask for a name and turn 'John' into J,o,h,n? I assume it can be done, but is there some simple command to do it directly when receiving the or does it take something more complex after the input is entered?
1 Answer
+ 5
s = "John"
l = list(s)
print l # ['J','o','h','n']