Real quick question. If I have a string 'hi my name is bill' and I want to reduce this to a list of letters, with no whitespaces (eg ['h', 'i', 'm', 'y'] as opposed to ['hi', 'i', ' ' , 'm', 'y', ' ', 'n'...]), is there a really quick and tidy way to do this? Or should I say, what is the best way?
If I use:
s='hi my name is bill'
print list(s)
Spaces are not removed.
I've also thought to try:
ls=[letter for letter in s.split() if letter != ' ']
This doesn't work because first of all, I can't seem to find the whitespace character for python, and also seems like it should have a builtin way.
What do you guys think?