擅长:python、mysql、java
<p>你可以这样做(可能还有其他方法):</p>
<pre><code>(1) print "First number is {} and second number is {}".format(first, second)
(1b) print "First number is {first} and number is {second}".format(first=first, second=second)
</code></pre>
<p>或者</p>
<pre><code>(2) print 'First number is', first, ' second number is', second
</code></pre>
<p>或者</p>
<pre><code>(3) print 'First number %d and second number is %d' % (first, second)
</code></pre>
<p>或者</p>
<pre><code>(4) print 'First number is' + str(first) + 'second number is' + str(second)
</code></pre>
<p>如果可用,最好使用<em><a href="http://docs.python.org/library/stdtypes.html#str.format" rel="noreferrer">format()</a></em>(1/1b)。</p>