擅长:python、mysql、java
<p>试试这个:</p>
<pre><code>import re
for line in lines:
print(re.sub(' ',' | ',line))
</code></pre>
<p><strong>或</strong></p>
<p>就你而言:</p>
<pre><code>for l in mult_table:
for i,x in enumerate(l):
if i != len(l)-1:
print(x,end=' | ')
else:
print(x,end=' ')
print('')
</code></pre>