擅长:python、mysql、java
<p>您可以<a href="https://docs.python.org/3/library/functions.html#map" rel="noreferrer">^{<cd1>}</a>字符串<code>int</code>:</p>
<pre><code>for c in map(int, string):
# do stuff with c
</code></pre>
<p>演示:</p>
<pre><code>>>> for c in map(int, '100124'):
... c
...
1
0
0
1
2
4
>>>
</code></pre>