The character in Python is a string of length 1, so you can iterate through a string, access each character in turn, and get the processing premise you want;
A list is a good idea, like this:thelist = List (thestring)
Of course, there is absolutely no list, and for those who like to iterate, they have a good reason to do so because there is no process to create a list:
For C in TheString:
Do_something_with (c)
Those who know the derivation of the list must not be bothered by the above notation, because the following code is something they are often proud of:
results = [Do_something_with (c) for C in TheString]
But no matter what you do, there will always be questions, but this is where Python is fun:
Results = map (Do_something_with, TheString)
If you want to get a collection of all the characters, because the collection has a special and wonderful operation:
1 Import sets 2 A = sets. Set ('My name is thinker')3 B = sets. Set ('Hello, thinker')4print'. Join (A & B)
Summary: Think of a simple problem, with different methods to solve, is a very enjoyable thing ....