擅长:python、mysql、java
<p>相邻的两个字符串文本将自动连接;<strong>这只适用于两个文本,而不适用于任意字符串表达式</strong>:</p>
<pre><code>>>> 'str' 'ing' # <- This is ok
'string'
>>> 'str'.strip() + 'ing' # <- This is ok
'string'
>>> 'str'.strip() 'ing' # <- This is invalid
File "<stdin>", line 1, in ?
'str'.strip() 'ing'
^
SyntaxError: invalid syntax
</code></pre>
<p><a href="https://docs.python.org/3.2/tutorial/introduction.html#strings" rel="nofollow noreferrer">The Python Tutorial</a></p>
<p>更清晰:
<a href="https://i.stack.imgur.com/qXFcG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qXFcG.png" alt="enter image description here"/></a></p>