每次处理一个字符,有以下三种方法:
1
for c in thestring:
do_something_with(c)
2
result=[do_something_with(c) for c in thestring]
3
result=map(do_something,thestring)
每次处理一个字符,有以下三种方法:
1
for c in thestring:
do_something_with(c)
result=[do_something_with(c) for c in thestring]
3
result=map(do_something,thestring)