擅长:python、mysql、java
<p>看这一行:</p>
<pre><code>xRan = print(nPrint, datetime.datetime.now().strftime("%H:%M:%S"))
</code></pre>
<p>这里您尝试打印<code>nPrint</code>,而<code>nPrint</code>是一个函数,您应该添加<code>()</code>来调用它。另外请注意,此函数本身能够打印数字,因此无需调用<code>print(nPrint())</code>,因为此函数返回<code>None</code>,因此打印将毫无用处:</p>
<pre><code>nPrint()
print(datetime.datetime.now().strftime("%H:%M:%S"))
</code></pre>
<p>注意,不需要将<code>print()</code>结果保存到<code>xRan</code>变量</p>